Subject | RE: [firebird-support] Query performance / DESC order |
---|---|
Author | Rick DeBay |
Post date | 2005-03-08T21:47:07Z |
The T.TRANSREF order wouldn't use the TRANSACTIONNOTE_TRANSREF index, so
the dummy-zero math wouldn't change that.
I think you may be SOL. The planner is using the two indexes (probably)
generated by the foreign key (another guess) between
Transactions.TransRef and TransactionNote.TransRef, which are always
ascending.
I don't think the planner can use two indexes on a stream, unless they
are ORed together.
Nevermind, I see it's going through all of Transactions.
Is the plan different for the fast case? If so, change the index it is
using for ORDER to the descending one.
-----Original Message-----
From: Robert martin [mailto:rob@...]
Sent: Tuesday, March 08, 2005 4:28 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Query performance / DESC order
Tried + 0 no improvement.
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
the dummy-zero math wouldn't change that.
I think you may be SOL. The planner is using the two indexes (probably)
generated by the foreign key (another guess) between
Transactions.TransRef and TransactionNote.TransRef, which are always
ascending.
I don't think the planner can use two indexes on a stream, unless they
are ORed together.
Nevermind, I see it's going through all of Transactions.
Is the plan different for the fast case? If so, change the index it is
using for ORDER to the descending one.
-----Original Message-----
From: Robert martin [mailto:rob@...]
Sent: Tuesday, March 08, 2005 4:28 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Query performance / DESC order
Tried + 0 no improvement.
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
>Could you try and change the "order by" to something like:char/varchar)
> order by T.TRANSREF+0 desc (or T.TRANSREF||'' if TRANSREF is
>in an attempt to avoid the "INDEX (TRANSACTIONNOTE_TRANSREF)" in theplan.
>Yahoo! Groups Links
>
>--
>Aage J.
>
>
>
>
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>