RE: [firebird-support] index use when using order by

2019-09-18 Thread 'Andrew Zenz' and...@aimsoftware.com.au [firebird-support]
-support@yahoogroups.com Subject: Re: [firebird-support] index use when using order by On 2019-09-18 06:46, liviuslivius liviusliv...@poczta.onet.pl [firebird-support] wrote: > Hi > > your problem is that you have ascending index, which is not usable in > descending queries. You ne

Re: [firebird-support] index use when using order by

2019-09-18 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-09-18 06:46, liviuslivius liviusliv...@poczta.onet.pl [firebird-support] wrote: > Hi > > your problem is that you have ascending index, which is not usable in > descending queries. You need to create descending index and it then > can be used in e.g. max queries. Ascending index is used

Re: [firebird-support] index use when using order by

2019-09-17 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-09-18 02:11, 'Andrew Zenz' and...@aimsoftware.com.au [firebird-support] wrote: > Firebird 2.5.7 (WI-2.5.7.27050) > > Just realised I 'should' be using 2.5.8, but on a server running > WI-V2.5.8.27089 it still uses NATURAL. Be aware, the latest version of Firebird 2.5 is 2.5.9, not

RE: [firebird-support] index use when using order by

2019-09-17 Thread 'Andrew Zenz' and...@aimsoftware.com.au [firebird-support]
Subject: RE: [firebird-support] index use when using order by Hi your problem is that you have ascending index, which is not usable in descending queries. You need to create descending index and it then can be used in e.g. max queries. Ascending index is used in min queries and order by xx asc

RE: [firebird-support] index use when using order by

2019-09-17 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hiyour problem is that you have ascending index, which is not usable in descending queries. You need to create descending index and it then can be used in e.g. max queries. Ascending index is used in min queries and order by xx asc.Regards,Karol Bieniaszewski null

RE: [firebird-support] index use when using order by

2019-09-17 Thread 'Andrew Zenz' and...@aimsoftware.com.au [firebird-support]
reads, 0 writes. 0 inserts, 0 updates, 0 deletes, 4 index, 0 seq. Delta memory: 20548 bytes. Total execution time: 0.031s Script execution finished. Cheers, Andrew Zenz From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroup

RE: [firebird-support] index use when using order by

2019-09-17 Thread 'Andrew Zenz' and...@aimsoftware.com.au [firebird-support]
I performed a trace and this is the result. I suspected it was doing an order by: Preparing Statement 5694738 : SELECT "ID","USERNAME","USERNO","LOGDATE","LOGTIME","LOGTABLE","RECORDKEY","REC ORDACTION","RECORDBEFORE","RECORDAFTER" FROM "AIMLOG" WHERE ("ID" <= ? ) ORDER BY "ID" DESC Time