Frage

I have an RDF Graph in Oracle that has approx. 7 ,000, 000 triples(rows)

I have a simple select statement that get's old duplicates (triples) and it deletes them from this RDF Graph.

Now, let's say my SELECT returns 300 results, this gets computationally very expensive since the DELETE does a full scan of the TEST_tpl table 300 times and as I said TEST_tpl has approx.

7 ,000, 000 rows...

DELETE FROM TEST_tpl t WHERE t.triple.get_subject() 
IN 
(
    SELECT rdf$stc_sub from rdf_stage_table_TEST 
    WHERE  rdf$stc_pred LIKE '%DateTime%'
)

I am trying to find the way to create an oracle procedure that would go through table only once for multiple values...

Or maybe someone knows of a better way...

War es hilfreich?

Lösung

The way I solved this is I created an INDEX on triple.get_subject()

CREATE INDEX "SEMANTIC"."TEST_tpl_SUB_IDX" 
ON 
"SEMANTIC"."TEST_tpl" ("MDSYS"."SDO_RDF_TRIPLE_S"."GET_SUBJECT"("TRIPLE"))

This improved the performance tremendously.

Thank you @Justin Cave and @ Michael for your help.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top