Subject Re: [ib-support] Index problem
Author Paul Reeves
guido.klapperich@... wrote:
> Do you mean, the greater the value of RDB$STATISTICS is, the faster will the
> query be ?

No. For a start the value stored is the reciprocal - 1.0 / count of
unique values. All the value indicates is how selective the index is.

Two rows, each with different values will produce a selectivity of 0.5.
One thousand rows will also produce a selectivity of 0.5 if the values
are Male/Female, True/False etc. That is an extreme example but you get
the idea.

The selectivity is only checked once, however, and is not of too great a
use. At worst, if the selectivity is out of date the optimiser may guess
and choose the wrong index. However, the optimiser isn't too clever
anyway. And typically, in most databases, there are not that many
indexes to choose from - so the accuracy of selectivity wouldn't matter.

Can you tell us the plan that is chosen for your test query, both before
the indexes are reset and after? It would be interesting if it was


Paul Reeves
taking InterBase further