Quantcast
Channel: Question and Answer » oracle
Viewing all articles
Browse latest Browse all 717

Last few rows from a non-indexed table in Oracle

$
0
0

I’m trying to run a query on an Oracle DB through SQL Server [dont' ask, it's a requirement]
The Oracle table in question [lets call it hugeTable] has over 200 million rows and no index. I’m not allowed to alter the structure in any way.
I need to fetch some rows from hugeTable for a inner join with another Oracle table from the same DB [not as large, can retrieve data easily].

The data in question [based on the criteria I have], is towards the end and as such takes forever to be pulled. This causes a timeout on the Oracle side of things and it returns no rows.
Running the query directly on Oracle DB returns the data but only if I set the timeout to 0.

My question is:
Is there a way to fetch the rows I need from hugeTable in this current scenario?

My query looks a bit like this:

SELECT 
TABLE1.COL1, TABLE1.COL2, TABLE2.COL1, ETC..
FROM TABLE1 
INNER JOIN TABLE2
ON [A COUPLE OF COLUMNS]
INNER JOIN hugeTable 
ON [A COUPLE OF COLUMNS]
GROUP BY 
a bunch of stuff
HAVING
hugeTable.Column1 = 'something'
and TABLE1.COLUMN3 = 'SOMETHING'

Viewing all articles
Browse latest Browse all 717

Trending Articles