Subject Re: High selectivity
Author peter_jacobi.rm
--- In firebird-support@yahoogroups.com, "Alex" <_a_x_e_@y...> wrote:
> this does not help, even with this "trick" you will get the same huge
> amount of hits when doing the select!
> You should use an index only when the number of records you are
> searching with select are approximately less than 2% percent of all
> records in this table (low selectivitiy like helen said)!
>
> in the case of two stats (0 / 1, male/female, yes/no) it does not
> make sense to use an binary tree index because the binary tree will
> have only 2 leaves, each containing a sequential list.

But the usecase discussed wasn't male/female. There are
only very few record in state 0, certainly less than 2%. So
the hack described should work.

Regards,
Peter Jacobi







>
> the only kind of index which would help is a bitmap index. a
> technology of 60th years. dont know if any DBS is really using it.