Subject Re: High selectivity
Author peter_jacobi.rm
Hi Helen, Jonathan, All,

--- Helen Borrie, responding to Jonathan wrote:
> >Suppose for instance that I have a STATE field on a table, that has two
> >possible values, 0 and 1.
> > I know in advance that I will
> >almost never need to select all records in STATE 1, but very frequently
> >all records in STATE 0, would it not be advantageous to define an
> No way. Firebird maintains indexes as binary trees. An indexed
search on
> this index would take forever and a day shinning up and down two
> chains of duplicates.

As I have a similiar use case, I thought about this.

So perhaps, fill the state columns with a generator, and when
state goes from 0 to 1, add a large enough constant, say

Somewhere in your front app you discard the lower 9 decimal digits on
display, and replace
WHERE state = 0
WHERE state BETWEEN 0 AND 999999
for retrieval

Peter Jacobi