SQL Server has a thing called "multi-column statistics", but it's not what one think it would mean.
Let's take a look at the following sample table:
CREATE TABLE BadStatistics
(
IsArchived BIT NOT NULL,
Id INT NOT NULL IDENTITY PRIMARY KEY,
Mystery VARCHAR(200) NOT NULL
);
CREATE NONCLUSTERED INDEX BadIndex
ON BadStatistics (IsArchived, Mystery);
With that, two statistics are being created on the two indexes we have:
Stats for BadIndex:
+--------------+----------------+-------------------------+
| All density | Average Length | Columns |
+--------------+----------------+-------------------------+
| 0.5 | 1 | IsArchived |
+--------------+----------------+-------------------------+
| 4.149378E-06 | 37 | IsArchived, Mystery |
+--------------+----------------+-------------------------+
| 4.149378E-06 | 41 | IsArchived, Mystery, Id |
+--------------+----------------+-------------------------+
+--------------+------------+---------+---------------------+----------------+
| RANGE_HI_KEY | RANGE_ROWS | EQ_ROWS | DISTINCT_RANGE_ROWS | AVG_RANGE_ROWS |
+--------------+------------+---------+---------------------+----------------+
| 0 | 0 | 24398 | 0 | 1 |
+--------------+------------+---------+---------------------+----------------+
| 1 | 0 | 216602 | 0 | 1 |
+--------------+------------+---------+---------------------+----------------+
Stats for clustered index:
+--------------+----------------+---------+
| All density | Average Length | Columns |
+--------------+----------------+---------+
| 4.149378E-06 | 4 | Id |
+--------------+----------------+---------+
+--------------+------------+---------+---------------------+----------------+
| RANGE_HI_KEY | RANGE_ROWS | EQ_ROWS | DISTINCT_RANGE_ROWS | AVG_RANGE_ROWS |
+--------------+------------+---------+---------------------+----------------+
| 1 | 0 | 1 | 0 | 1 |
+--------------+------------+---------+---------------------+----------------+
| 240999 | 240997 | 1 | 240997 | 1 |
+--------------+------------+---------+---------------------+----------------+
| 241000 | 0 | 1 | 0 | 1 |
+--------------+------------+---------+---------------------+----------------+
(I've populated the table with random sample data where about a tenth of the rows are non-archived. I ran a full scan statistics update afterwards.)
Why does the histogram of the two-column stats only use one column? I know that numerous people have written about that it does, but what's the rationale? In this case, it makes the whole histogram a lot less useful, because the first column only ever has two values. Why would stats be arbitrarily restricted like that?
Please note that this question isn't referring to multi-dimensional histograms, which are an entirely different beast. It's about single-dimensional histograms with the single dimension being the tuples containing the respective, multiple columns.