Subject Re: [firebird-support] Re: Compound Index
Author Arno Brinkman
Hi,

>> It is not question whether it helps much or not. Without ORDER BY
>> the query does not make sense at all.
>
> I've added the order by clause and retried it with IBOConsole to check
> the statistics.
>
> The query is SELECT FIRST 10 * FROM MY_TABLE WHERE COLUMN1 > 100 ORDER
> 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

<snip>
> Plan: PLAN (MY_TABLE ORDER MY_INDEX INDEX (MY_INDEX))
> Rows affected: 89901

The Rows Affected number is something i don't get yet.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database developer support:
http://www.databasedevelopmentforum.com

Firebird open source database (based on IB-OE) with many SQL-99 features:
http://www.firebirdsql.org
http://www.firebirdsql.info

Support list for Interbase and Firebird users:
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep:
news://newsgroups.firebirdsql.info