Query intersect functionality

Discussion created by fss_gsm on Dec 15, 2013
Hi all,

I'm currently developing an application that allows users to draw geometry on a map, and then this geometry is used to search against a point feature class stored in Oracle SDE (st_geometry).

Am I correct in say that when using the query/querytask functionality and supplying a search geometry, ArcGIS Server will query the layer for any points that intersect the _envelope_ of the search geometry, and then do the intersect itself in memory?

The reason I ask is that when a user draws any geometry which has an extent far bigger than the geometry itself (for example a diagonal line), we are noticing serious performance hits when attempting to run the query. I'm not even referring to displaying the results - just running the query against the map service endpoint is slow.

While the dataset that is being queried is big (3 million records), a search will often only return 1000 points, which I think is a reasonable amount. But it can take up to 2 minutes for this query to execute and the results to be returned.

Are there any improvements I can make or functionality I could implement which might help me to speed up the query?