Subject | Slow Query |
---|---|
Author | trimeche_hafedh |
Post date | 2011-10-10T10:31:34Z |
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))
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))