Subject Re: Compound Index
Author pokka_chi
--- In firebird-support@yahoogroups.com, "Ivan Prenosil"
<Ivan.Prenosil@...> wrote:
> You shoud provide more informations - how big is the table,
> how selective is Column1, how does the whole statement look,
> plan and statistics, how much poor is "very poor", etc...
>

The table has 500,000 records and a total size of 2GB. Column1 and
Column2 are integer fields and there is an index on Column1 alone and a
compound index on (Column1, Column2).

The sql is select first 100 * from my_table where column1 > 1 or
column1 = 1 and column2 > 2.

I've also try select first 100 * from my_table where column1 > 1 and
select first 100 * from my_table where column1 = 1 and column2 > 2.
Both are very slow. I expect the optimizer should be smart enough to
pick the right index.

PK