Subject Re: [firebird-support] Different plans on query
Author Arno Brinkman
Hi,

> Excuse me Ivan...
>
> Selectivity is
> SingleRowInTable / TotalRows
>
> In PK this is 1 and index has the better selectivity
>
> when SingleRowInTable become < TotalRows then selectivity decrease --> 0
> so bigger values (near 1) are better for selectivity.
>
> I'm wrong?

Yes you're wrong ;-)
Ivan is completly right the lower the selectivity the beter.

Calculated selectivity is with this formula :

Selectivity = 1.0 / (Nr_of_index-entries - Nr_of_duplicates)

If the number of duplicates is high in the index then the index-selectivity
value is higher, but worser to use.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird open source database (based on IB-OE) with many SQL-99 features :
http://www.firebirdsql.org
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/

Support list for Interbase and Firebird users :
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep :
news://80.126.130.81