Subject | Re: [firebird-support] Re: Compound Index |
---|---|
Author | Ivan Prenosil |
Post date | 2007-05-04T00:25:33Z |
>> The query is SELECT FIRST 10 * FROM MY_TABLE WHERE COLUMN1 > 100 ORDERArno,
>> BY COLUMN1, COLUMN2
>
> As Ivan already suggested what is the nr. of reads if you use this query :
>
> SELECT FIRST 10 * FROM MY_TABLE WHERE COLUMN1 >= 101 ORDER BY COLUMN1, COLUMN2
In older FB versions, the clause WHERE COLUMN1 > 100 caused that
even rows with COLUMN1=100 were internally fetched (and discarded).
Now with FB2 I made a test, and the statistics looks like the index
is read for values COLUMN1 >= 100, but only rows with COLUMN1 > 100
are fetched, is it possible ? (The difference of fetches for these two conditions
seems equal to the number of index pages required for indexing value 100)
Anyway, ">" now performs much faster thanks to not fetching "=" values.
Was this improved/fixed in FB2 ? I do not remember
to see any note in Release notes ...
Ivan