Subject | Re: Compound Index |
---|---|
Author | pokka_chi |
Post date | 2007-05-02T12:36Z |
--- In firebird-support@yahoogroups.com, "Ivan Prenosil"
<Ivan.Prenosil@...> wrote:
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
<Ivan.Prenosil@...> wrote:
> You shoud provide more informations - how big is the table,The table has 500,000 records and a total size of 2GB. Column1 and
> how selective is Column1, how does the whole statement look,
> plan and statistics, how much poor is "very poor", etc...
>
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