Slow execution of query with 2 conditions
Query plan for query
select * from Persons p where (p.Id = 68057) or
(p.Id in (select FromId from links where ToId = 68057))
has "TABLE ACCESS FULL" operation and query execution is much slower than execution of queries with one of
condition:
select * from Persons p where (p.Id = 68057),
select * from Persons p where (p.Id in (select FromId from links where ToId = 68057)) .
I tested this problem on 10.2.0.4 version for Linux 64-bit and on 11.2.0.1 for Windows 32-bit.
The only way to improve execution time that I know is to use "union" instead of "or".
Can any existing version of Oracle Database execute this query quickly?
select * from Persons p where (p.Id = 68057) or
(p.Id in (select FromId from links where ToId = 68057))
has "TABLE ACCESS FULL" operation and query execution is much slower than execution of queries with one of
condition:
select * from Persons p where (p.Id = 68057),
select * from Persons p where (p.Id in (select FromId from links where ToId = 68057)) .
I tested this problem on 10.2.0.4 version for Linux 64-bit and on 11.2.0.1 for Windows 32-bit.
The only way to improve execution time that I know is to use "union" instead of "or".
Can any existing version of Oracle Database execute this query quickly?
0