Subject Re: one performance/index question
Author Adam
--- In firebird-support@yahoogroups.com, "Sasa Mihajlovic"
<majstoru@...> wrote:
>
> Hi,
>
> few days ago I was do the Database Statistics and in the report I have
> some bad indexes, for example I have a field session which is represent
> a fiscal year in table invoices. so do I need to index that field
> because I have only 3-5 different values and I often use this field in
> my sql statetmets like very important in where clausule?
>

Usually such poor selectivity will make performance worse. Indices can
only be of benefit if they eliminate the need to read data pages from
disk. When there are so many duplicates, the chances of being able to
ignore an entire data page is reduced to near 0.

Adam