I'm trying to speed up a query against a geometry lookup and I don't know where to put the index. What is happening is I'm creating a polygon and based on its centroid, selecting a value (G.ID) to insert into a column. The sample of my case statement is:
WHEN :new.ZONE = 'ETMA1' THEN
SELECT G.ID into :new.WU
FROM GRID_ETMA1 G
WHERE
(sde.st_intersects (st_centroid(:new.shape), G.shape) = 1)
AND. (sde.st_within (st_centroid(:new.shape), G.shape) = 1);
Any advise or rewrite is appreciated.
Jeff