By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,071 Members | 1,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,071 IT Pros & Developers. It's quick & easy.

selecting ROWNUM causes query to take forever

P: n/a
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
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

Jul 19 '05 #2

P: n/a
> 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.
Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.