Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL Query Very Slow
Hi,
we have the following problem with a simple SQL query:
SELECT A.ID, A.VON, A.BIS, B.ID, B.VON, B.BIS
FROM A, B
WHERE A.ID = 123
AND A.AB_ID = B.ID AND A.BIS > B.VON AND B.BIS > A.VON
Table A is
ID, VON, BIS, AB_ID
primary key is on ID, VON
no other indices
Table B is
ID, VON, BIS
primary key is on ID, VON
no other indices
Table A and B have 30.000 records each.
The creteria WHERE A.ID = 123 AND A.AB_ID = B.ID alone returns only a few
records
and executes very fast (some seconds). When I add the other two creterias as
shown
above the query needs several minutes to execute. It seems that ORACLE
"optimizes"
the query in a way which is very inefficient. Can someone give many any
hints to speed
up this thing.
many thanks
Thorsten Bertram
thorsten.bertram_at_planware.com Received on Tue Mar 07 2000 - 00:00:00 CST