473,320 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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
Jul 19 '05 #1
2 3942
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
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kevin Crosbie | last post by:
Hi all, (Sorry for the cross-post, there doesn't appear to be much activity on comp.database.oracle)I'm trying to get the last 300 rows from the difference between 2 large tables and my queries...
9
by: Sandy | last post by:
I am trying to do the following: EXEC SQL UPDATE MY TABLE SET COL1 = :newValue WHERE COL1 = 0 AND ROWNUM = 1 ORDER BY COL2; (index on COL1, COL2)
8
by: Agoston Bejo | last post by:
Take a look at the following example: table T(i INTEGER, j INTEGER) I want to get the value of i where j is minimal and some conditions apply. (1) SELECT i FROM T WHERE AND j
4
by: pierig.gueguen | last post by:
Hello, I would like to know if the equivalent Oracle rownum exist in SQLServer. Here is a sample SQL code to explain what I want to do : select jobs.name, jobs.job_id, jobs.description,...
5
by: uthuras | last post by:
Machine : AIX 5.2 Product : UDB DB2 Release 8.1 FP4a I have problem loading data into destination table. The data file is huge with more than 6 Million records. This what i have done 1....
7
by: Bernard Lebel | last post by:
Hello, I'm stumbled at a serious problem, and quite frankly getting desparate. This is a rather long-winded one so I'll try to get straight to the point. I have this Python program, that...
2
by: krishhhna | last post by:
If we want to retrive 5,6,7 rows from a table,then we used rownum in a query in group by clause,but my doubt is rownum has individual values for each rows then how did you group rows based on...
6
by: pradeep kaltari | last post by:
Hi All, I was just going through EMP table in oracle Scott schema. Say, I want to find out the first employee in alphabetical order who's name starts with 'A'. the following query gives me the...
2
by: Paul Bradford | last post by:
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.