Subject High selectivity
Author Jonathan Neve
Hi!

Everyone always says that one should avoid indices with high
selectivity, and that they can even make the query slower.
I understand that.
But doesn't that depend on how evenly the values are distributed?
Suppose for instance that I have a STATE field on a table, that has two
possible values, 0 and 1.
All new records start out in STATE 0, and after a while, they end up in
STATE 1. Obviously, the number of records in STATE 0 will remain roughly
constant, whereas the number of records in STATE 1 will be continually
growing. If (as it is highly likely), I know in advance that I will
almost never need to select all records in STATE 1, but very frequently
all records in STATE 0, would it not be advantageous to define an index?

Thanks!

Jonathan Neve.