I have a feature class with around 1 million polygon features. I'm using the following query to return features from the polygon feature class that intersect a specified point location (x, y not a point feature).

select * from polygon_feature_class where st_within(sde.st_geometry (x-value, y-value, null, null, srid), shape-field) = 1;

The problem is this query is very slow. It takes 10+ minutes to run through the table. Is there a way I can limit the search radius to say 1000 meters?

In my mind, the process would be "give me the features this point intersects but stop searching after you exceed a 1000 meter radius from the initial point".

In lieu of a way to limit the search radius, how can I improve this query?

I'm stuck the feature class and all its features and I need to start with a point specified as x,y. How I get the polygon(s) that contain the point is open but it needs to be much faster than what I'm currently using.

The query will run against ArcSDE running on Oracle, features stored as st_geometry. Eventually, this SQL will run from an ArcPy script but I'm currently using TOAD.

  • 1
    In ArcGIS desktop I'd re-define environment extent, using point coordinates and radius
    – FelixIP
    Feb 14, 2017 at 19:10

1 Answer 1


I switched to using st_intersects and changed the order of the parameters to use the spatial index on the geometry column. Now I get results in a few milliseconds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.