Subject Re: [firebird-support] Different plans on query
Author dade2000
Arno Brinkman wrote:

> 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.

Thanx for "fix".My formula is general for any index but doesn't match
the FB ones :-(

Thanx Daniele