| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Query optimisation
Hi, I have a small query that is running like a dead pig and
wondered if anyone could help me optimise it a little.
Two tables Locations and Data
Locations has PK Location Key Id
Data has FK Location Key Id
The query
SELECT *
FROM locations
WHERE locations.[location key id]
IN
(SELECT distinct Data.[Location Key Id]
FROM Data
WHERE Data.[Customer Key Id]= " & G_Customer_Key_Id & ");"
The table Data is relatively flat with around 30 fields, locations has just 3
With 50000 records for one customer it takes around 30 seconds to process, seems far to slow.
Anyone?? Received on Wed Aug 06 2003 - 11:04:41 CDT
![]() |
![]() |