Database Tuning (MOSC)

MOSC Banner

How to get rid of "SORT ORDER BY"

edited Jan 29, 2009 12:04AM in Database Tuning (MOSC) 7 commentsAnswered
Hi,
I have a question regarding query optimization. I have an Oracle database server 11.0.7.0 running on AIX 6.1.

I am executing the following statement:
SELECT /*+FIRST_ROWS(914) INDEX(AENDERUNG11 PK_AENDERUNG11_CAT)*/
         aenderung11.ROWID, aenderung11.satznr, aenderung11.vsnr,
         aenderung11.pkz, aenderung11.llfdnr, aenderung11.aktnr,
         aenderung11.seslfdnr, aenderung11.eingbs, aenderung11.erlam,
         aenderung11.aendart
    FROM aenderung11
   WHERE (aenderung11.pkey > :0)
ORDER BY aenderung11.pkey ASC

"pkey" is a virtual column containing a concatenation of the string values of all primary key columns.
"PK_AENDERUNG11_CAT" is an ascending index for "pkey".

This is the explain plan of the statement:
SELECT STATEMENT  HINT: FIRST_ROWS Cost: 176,239              

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center