Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to optimize queries with ORDER BY field DESC

Re: How to optimize queries with ORDER BY field DESC

From: Young-chul,Jun <ycjun_at_hotmail.com>
Date: Mon, 14 Sep 1998 14:46:46 +0900
Message-ID: <6tia0h$mal$1@news.kren.nm.kr>


Hello :)

In my opinion..
Hint Statement will help you.
DESC is not necessary to solve it :)

select /*+INDEX_DESC (Table1 index_name)*/ columns...  where id < something

Thanks~~

Young-chul,Jun ycjun_at_hotmail.com OCP ~~
Samsung SDS, KOREA

frleong_at_bigfoot.com ÀÌ(°¡) <6ti59i$rm2$1_at_nnrp1.dejanews.com> ¸Þ½ÃÁö¿¡¼­ ÀÛ¼ºÇÏ¿´½À´Ï´Ù...
>Hello!
>
>I have got a relatively small table of around 4000 rows stored in an Oracle
>7.2 database with a primary key field called ID. The users need to perform
>some ad-hoc queries like:
>
>SELECT * FROM Table1
>WHERE ID<Something
>ORDER BY ID ASC
>
>The above query is almost instantaneous and so no problems.
>
>However, the queries take much longer if they are changed to
>SELECT * FROM Table1
>WHERE ID<Something
>ORDER BY ID DESC
>
>The descending sort seems to be the troublemaker. What can I do to speed up
>both queries? Do I need to create more indexes? If this is so, how? Thanks.
>
>Francisco Leong
>---
>frleong_at_bigfoot.com
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
Received on Mon Sep 14 1998 - 00:46:46 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US