How to optimize speed of a select query

531
1
10-11-2018 01:40 PM
ShaniquaRayford
New Contributor
The issue I am having is that when I run a query using the Esri ST_Geometry package it is
taking up to 5 minutes to give a result. It is possible that it may be because
of the large number of records in the view.
Below is an example of the query I am running:
 

select sectionnumber from land.fisgridsection_vw

where sde.st_overlaps(sde.st_buffer(

(SELECT shape FROM land.fisgridsection_vw

WHERE sde.st_intersects(sde.st_point(792026,335093,2274),shape) = 1),1),shape)= 1;

 
My question is "how can I optimize the speed of this query?" Are there any other options
I could use?
0 Kudos
1 Reply
JoshuaBixby
MVP Esteemed Contributor

Honestly, it is really difficult to troubleshoot performance issues like this in the forums unless you can provide a whole lot more information about the data, SQL execution plans, etc....

Since this involves multiple spatial operations, have you broken the problem down to see at which step the execution time increases the most?  For example, how long does it take for:

SELECT shape FROM land.fisgridsection_vw
WHERE sde.st_intersects(sde.st_point(792026,335093,2274),shape)

a