SQL optimizations in Oracle

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rishi Kumar

    SQL optimizations in Oracle

    consider the following queries that deals with report pagination

    a ) select MYROWS.* from
    (select * from TABLE_NAME) MY_ROWS where rownum between 1 and 100

    b) select * from TABLE_NAME where rownum between 1 and 100

    My question : Does oracle optimize the first query so that it is not
    significantly different (on execution time) when compared to the
    second query ?

    Thanks

    Rishi
  • Romeo Olympia

    #2
    Re: SQL optimizations in Oracle

    I had a previous post on this thread which was mildly out of whack.
    What was I thinking!?

    Your queries using ROWNUM will not work for your pagination purposes.
    Period.
    You cannot get "page 2" by saying "select ... from ... where rownum
    between 101 and 200".

    Cheers.

    v_rishi_k@yahoo .com (Rishi Kumar) wrote in message news:<fd3b9393. 0408262011.613c bdfe@posting.go ogle.com>...
    consider the following queries that deals with report pagination
    >
    a ) select MYROWS.* from
    (select * from TABLE_NAME) MY_ROWS where rownum between 1 and 100
    >
    b) select * from TABLE_NAME where rownum between 1 and 100
    >
    My question : Does oracle optimize the first query so that it is not
    significantly different (on execution time) when compared to the
    second query ?
    >
    Thanks
    >
    Rishi

    Comment

    Working...