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.