{{theTime}}

Search This Blog

Total Pageviews

LEFT OUTER JOIN and "OR" condition in Oracle

If you use LEFT OUTER JOIN and "OR" condition in Oracle, even though you have the indexes on tables, table scan will be performed.   Instead you can try 'EQUI-JOIN".  There is no issue in Sqlserver.

Eg:
Bad query:
select * from employee left outer join department on employee.dept_id=department.dept_id and (employee.profile_id = department.profile_id  or employee.group_id = department.group_id).  Even indexes on profile_id and group_id, table scan will be performed.

Instead use just equi join.

No comments:

java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport

SpringBoot Error: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.j...