sql - Full table scan or index scan -
there large oracle table a
, relatively large global temp table tb
used following query:
update set a.field0 = ( select sum(tb.field0) tb tb.field1 = a.field1 , tb.field2 = a.field2 , tb.field3 = 'value' ) exist ( select 1 tb tb.field1 = a.field1 , tb.field2 = a.field2 , tb.field3 = 'value' );
basically exist
condition used check if record ever existed. query, if there index on a.field0
, a.field1
, no index on tb
@ all, going full table scan or index scan? furthermore, where
condition necessary , performance impact it?
since there no indexes on tb
select
sub-queries in sql go full table scan on tb. if tb table large creating indexes on tb.field1
,tb.field2
,tb.field3
should give significant performance improvement.
Comments
Post a Comment