Hello, - Which firebird version? - Why do you've an index on every field? Is this really needed? - Are the index statistics up-to-date?
Regards, Arno Brinkman ABVisie -----Oorspronkelijk bericht----- From: trimeche_hafedh Sent: Monday, October 10, 2011 12:31 PM To: [email protected] Subject: [firebird-support] Slow Query This query takes long time to execute even the PROCESSINGMODE value is present in the records (10 000 000). The Engine continue looking other records and doesn't return immediately after the first record is located. Please how to force the query to return after n records located? SELECT FIRST 1 * FROM TXREQUEST WHERE (PROCESSINGMODE BETWEEN 5 AND 5) AND (CURRENCYCODE BETWEEN 0 AND 65535) AND (AMOUNT BETWEEN 0 AND 9.22337203685478E18) AND (DATETIME BETWEEN '2011-07-12 08:55:13.940' AND '2011-10-11 08:55:12.940') AND (RESPONSECODE BETWEEN 0 AND 32767) PLAN (TXREQUEST INDEX(TXREQUEST_PROCESSINGMODE,TXREQUEST_CURRENCYCODE,TXREQUEST_AMOUNT,TXREQUEST_DATETIME,TXREQUEST_RESPONSECODE)) ------------------------------------ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Yahoo! Groups Links
