Hello
I'm trying to perform a spatial query and I'm experiencing very slow performance when using ESRI Shapefiles versus VPF VMap data. This is especially true when the query returns no results which takes much longer than if results are returned.
I'm doing this all in C++.
I'm calling ITable->Search() which takes no time, but the first ICursor->NextRow() call then is taking the time. The passed IQueryFilter is from a SpatialFilter object and I've passed a simple polygon with 4 corners (actually a rectangle). The spatial relation I'm using on the filter is esriGeoDatabase::esriSpatialRelIntersects.
On my particular example dataset (the roads layer), when there are no features within the query polygon, it takes 844ms with the Shapefile, and 0ms with the VMap data. If there are features in the query polygon, it takes 156ms with the shapefile, and ~40ms with the VMap data.
Is there a reason why empty queries are so slow for shapefiles?
Is there a way that I can determine if the query will return no results without calling the NextRow() function?
Thanks for any help