Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why does my query do full scan on table ...?

Angelina84May 27 2014 — edited May 28 2014

I have a query with sub-query that should narrow down a search of triples:

DELETE FROM XPROCESS_TPL  t WHERE t.triple.rdf_s_id

IN

( SELECT r.value_id FROM mdsys.rdf_value$ r

  WHERE  r.value_type='UR'   AND  r.vname_suffix LIKE  'ProcessAggregate_Lens Fab%' )

the inner SELECT returns 122707 rows in 41.914 seconds

However, the outer query takes ~6 hours all together...

What I thought would happen was it should first do the sub-query,get all value_id's and then use index to find data in XPROCESS_TPL

Why is that not happening and how can I optimize this query?

I created index on rdf_s_id:

CREATE INDEX "SEMANTIC"."XPROCESS_SUB_IDX" ON "SEMANTIC"."XPROCESS_TPL" ("TRIPLE"."RDF_S_ID")

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 25 2014
Added on May 27 2014
9 comments
3,540 views