selecting ROWNUM causes query to take forever

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Bradford

    selecting ROWNUM causes query to take forever

    I have a query that takes about two minutes and returns 97 rows.
    If I change the query only by adding ROWNUM to the outermost
    select clause, the query never returns (I let it run overnight).
    I'm not using ROWNUM in the where clause, I'm just selecting it.
    I can't think of any reason that just selecting ROWNUM would make any
    difference. This is Orace 8.1

    I spent a day searching Google groups without finding anything on this.

    Any ideas?

    Thanks in advance,

    Paul


  • Frank

    #2
    Re: selecting ROWNUM causes query to take forever

    Paul Bradford wrote:
    I have a query that takes about two minutes and returns 97 rows.
    If I change the query only by adding ROWNUM to the outermost
    select clause, the query never returns (I let it run overnight).
    I'm not using ROWNUM in the where clause, I'm just selecting it.
    I can't think of any reason that just selecting ROWNUM would make any
    difference. This is Orace 8.1
    >
    I spent a day searching Google groups without finding anything on this.
    >
    Any ideas?
    >
    Thanks in advance,
    >
    Paul
    >
    >
    Crystal ball is in the repair shop. Why not post the query, explain
    plan, etc?

    --
    Regards, Frank van Bortel

    Comment

    • Paul Bradford

      #3
      Re: selecting ROWNUM causes query to take forever

      Paul Bradford wrote:
      >
      I have a query that takes about two minutes and returns 97 rows.
      If I change the query only by adding ROWNUM to the outermost
      select clause, the query never returns (I let it run overnight).
      I'm not using ROWNUM in the where clause, I'm just selecting it.
      I can't think of any reason that just selecting ROWNUM would make any
      difference.
      For reasons I don't understand, adding ROWNUM caused a different
      (and worse) execution plan. After I added some hints to get a good
      execution plan, my problem is solved.


      Comment

      Working...