Spatial Queries are very slow on large tables

1797
7
06-03-2011 10:30 AM
SimonOlsberg
New Contributor
I am trying to use the api to perform spatial queries on a relatively large databases (e.g. census blocks in North Carolina - a little under 300,000 records)

I use the Table::Search() method with an envelope which covers only a handful of blocks.
The Search method call itself completes quickly but enumerating over the small number of features in the EnumRows object returned is very slow - sometimes a call to EnumRows::Next() takes several seconds to return.

Is the API not able to make proper use of the spatial index?
0 Kudos
7 Replies
LanceShipman
Esri Regular Contributor
It's a bug with the usage of the spatial index.
0 Kudos
SimonOlsberg
New Contributor
So it is something that will likely be fixed in the next update? It's a pretty vital issue for making this a usable technology for working with file geodatabases.
Thanks
0 Kudos
LanceShipman
Esri Regular Contributor
It's likely to be fixed in the next update.
0 Kudos
SimonOlsberg
New Contributor
I just tried the new 1.1 API and unfortunately I don't see any improvement with this issue.
Was it supposed to have been fixed? Are there any detailed release notes describing the changes and fixes in each release?
Thanks
Simon
0 Kudos
LanceShipman
Esri Regular Contributor
The primary purpose of 1.1 was the .NET wrapper. We were able to fix a bug with domain assignment but the spatial index issue was not fixed in 1.1.
0 Kudos
SimonOlsberg
New Contributor
I had hoped that the new 1.2 version of the API would fix this issue - the release notes certainly seem to suggest that the spatial index is now being used correctly.
However I am still seeing a problem.
When I search on a large database within a small envelope, while the calls to enumRows->Next() that successfully return a found row within my envelope return quickly, the final call to enumRows->Next() which returns NULL indicating that there are no more rows with the envelope takes a very long time (i.e. upto 30 seconds in my example).
So something is still not right.

Simon
0 Kudos
LanceShipman
Esri Regular Contributor
I tested spatial search with a moderately large dataset (30+ million polygon features) and was able to retrieve a few thousand features in under one second. No lag on the final NEXT. Can you send your code? How many attributes does your feature class included. Does it include any blobs. Was the feature class created with the API or through ArcGIS.

You may want to drop your spatial index and re-create it.
0 Kudos