Subject | Re: [firebird-support] Re: Composite index question |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2007-05-04T22:27:06Z |
nz_fbsup wrote:
'where foo < 999999999 and bar > -999999999', where the numbers are
higher/lower than the maximum existing value (and no fields are null).
But my guess is that this will slow down the query rather than speed it
up (the optimizer is often right in its suggestions, and NATURAL may be
quicker than to use indexes when you have no WHERE clause limiting which
rows to return).
Set
>>> CREATE INDEX IDX_1 ON T (Foo DESC)You could try something like
>> No it didn't ;)
>
> Yes, it`s my typos, sorry. :)
>
>> You are using a query without a where clause. The optimiser thinks it
>> is quicker to read the data into memory
>
> Ok, but what is the 'where' (or PLAN?) clause that will "force" using
> individual ('desc foo', and 'asc bar') indexes?
'where foo < 999999999 and bar > -999999999', where the numbers are
higher/lower than the maximum existing value (and no fields are null).
But my guess is that this will slow down the query rather than speed it
up (the optimizer is often right in its suggestions, and NATURAL may be
quicker than to use indexes when you have no WHERE clause limiting which
rows to return).
Set