Subject Re: [firebird-support] Exclude records from index
Author Ann Harrison
Kjell,
>
> But you missed one consideration, that may actually be of some
> significance: backup time and backup space (which we rent per Gbyte).

And another one, insuring that the index is used when it should be and
not when it shouldn't. As someone else suggested, a selectivity histogram
is a good solution for indexes with odd distributions - makes it possible for
the optimizer to choose the index when appropriate ... though not so well
for parameterized statements, except in the case of NULL.

> Still, it would seem like a "nice-to-have" to be able to exclude nulls
> from an index. I assume this would mena that queries that needs nulls
> (possibly in combo with non-nulls) would be executed as if the index
> didn't exist, and queries that needs only non-nulls would be executed
> with the index included when creating the execution plan.

I reacted to the question of adding another table, but there might be
merit in an "exclude NULL" index.

Cheers,

Ann