Subject | Re: [firebird-support] Exclude records from index |
---|---|
Author | Ann Harrison |
Post date | 2011-06-14T14:52:38Z |
Kjell,
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.
merit in an "exclude NULL" index.
Cheers,
Ann
>And another one, insuring that the index is used when it should be and
> But you missed one consideration, that may actually be of some
> significance: backup time and backup space (which we rent per Gbyte).
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 nullsI reacted to the question of adding another table, but there might be
> 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.
merit in an "exclude NULL" index.
Cheers,
Ann