Oracle tuning tips PDF Print E-mail
All in One - Data
Written by Administrator   
Friday, 14 August 2009 07:19

Use Exists instead of IN

dont use : 27 seconds

select count(*) from pro 
where pro_id in
( select  pro_id from sales)


OK : 20 seconds

select count(*) from pro p
where exists
      ( select 1 from sales s
          where s.pro_id=c.pro_id

 

*

index should be created in different tablespace with table

 

Last Updated ( Tuesday, 25 August 2009 06:43 )