| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Performance in ORDER BY
Hello everybody!!
We have a SELECT running over our database. We only need several registers of a table of 800.000 values. In the SELECT when we put in comments the ORDER BY T.START_TIME DESC line, the instruction is executed in 7 seconds, but if we use the ORDER BY line, the execution goes to 8 minutes.
I would appreciate any tip very much, cos I am desperate with it.
Thanks in advance.
Abel S.
SELECT CCID,GROUP_ID, ....(other fields)
FROM (
SELECT S.CCID, S.GROUP_ID, ...., ROWNUM AS RN
FROM SITEINFO S,TIMESTMP T, ADDEF A, UNIT U
WHERE A.TYPE ='DI' AND T.STATUS = 'C' AND T.USER_ID IS NULL
AND S.CCID = T.CCID AND S.GROUP_ID = T.GROUP_ID AND T.FUNCT_NUM =
A.FUNCT_NUM AND U.FUNCT_NUM = T.FUNCT_NUM AND T.VALUE_NO =
A.VALUE_NO
ORDER BY T.START_TIME DESC
)
WHERE RN BETWEEN 4051 AND 4125;
Received on Thu Sep 22 2005 - 10:20:44 CDT
![]() |
![]() |