dcastano

SelectFeatures query slow when using only ObjectIds param

Discussion created by dcastano on Feb 21, 2013
Latest reply on Aug 14, 2013 by dcastano
I have recently found that when I attempt to use the following query to selectFeatures from a FeatureLayer the response is significantly slower if I use only the query.objectIds versus the query.where.  Below are the two samples:

//The query below runs much faster when using a where clause
var selQuery = new esri.tasks.Query();
//selQuery.where = "OBJECTID = " + [addResults[0].objectId];
selQuery.objectIds = [addResults[0].objectId];

//The query below takes about 40 seconds to run when using only the objectIds.
var selQuery = new esri.tasks.Query();
//selQuery.where = "OBJECTID = " + [addResults[0].objectId];
selQuery.objectIds = [addResults[0].objectId];


Essentially, I have to call FeatureLayer.selectFeatures after a new feature is created  so that I can show the custom attribute dialog to the user. The applyEdits addResults returns only the ObjectID and GlobalId along with a success (true/false). I have been able to wire all this successfully.  I was just hoping to move away from having to deal with a where clause and string manipulation vs just using an array of objectIds.

It just seems interesting to me that the query.objectIds ONLY takes so long to return the FeatureSet.  (Note the data that I am dealing with is very large .. national scale).

Has anyone else noticed this.  ESRI, is this a known issue or am I implemting the query.objectIds incorrectly? 

Thanks

Outcomes