Is there a point indexing a database column that does not have many different values?

For example, suppose I have a TYPE column that accepts only a few values. I have queries like

WHERE TYPE=...

Will indexing this column improve performance?

+3
source share
1 answer

If the selectivity of the columns is very low (i.e. not so many different values), then the query optimizer is unlikely to use the index in this column.

, , Active ( ), (.. Active false), WHERE Active = False Active. [ SQL Server 10% ]

( )

: SQL Server: BIT (, Damien)

SQL Server 2008, " " :

, . , NULL , NULL, , NULL . , .

+4

All Articles