Feature Table OBjectID

352
4
12-12-2022 07:57 AM
robymun
New Contributor II

Hello i have very big tables and on them i have to do intersection operation between graphics, example i have to find relations between sections and valves, in the old version 10.x.x there was the possibility to return only objectID as the return field of the query, this saved a lot of time and a lot of memory...example now i have read it via attributes (this table has more than 40 fields )... In version 100 there is no way to have only ObjectID as a return field on a Featuretable ?

Regards Roberto

 

0 Kudos
4 Replies
JoeHershman
MVP Regular Contributor

Look at Enum QueryFeatureFields  this should allow you to set to return IdsOnly

Thanks,
-Joe
0 Kudos
robymun
New Contributor II

Unfortunately, this solution is not good for a FeatureTable but only for ArcGISFeatures , I don't understand why there is no possibility to pass this QueryFeatureFields parameter in geodatabase queries

0 Kudos
dotMorten_esri
Esri Notable Contributor

Is your FeatureTable not of type ServiceFeatureTable? (ie can you cast it to this subclass?)
If it's a local non-service table, limiting the attributes doesn't have much effect, since you're not hitting the network.

0 Kudos
robymun
New Contributor II

 


@dotMorten_esri wrote:

Is your FeatureTable not of type ServiceFeatureTable? (ie can you cast it to this subclass?)
If it's a local non-service table, limiting the attributes doesn't have much effect, since you're not hitting the network.


 Hi, i can't cast GeodataBaseFeatureTable into a ServiceFeatureTable 😥

 I did some comparisons , in the old version 10.x there was on ios the following type of query

AGSQuery* queryIds = [AGSQuery query];
queryIds.geometry = geometryToIntersec;
queryIds.returnGeometry = false;
queryIds.spatialRelationship = AGSSpatialRelationshipIntersects;
[featureTable queryObjectIDsWithParameters:queryIds completion:^(NSArray *results, NSError *error)

this type of query returned only an array of objectIds which is what I need and it was super fast (I tested and the query runs in only 0.000320 milli seconds)

while now using a similar query in the 100.x version that however returns me all the data in the featureTable row takes us from 2-3 milliseconds ...this repeatedly executed thousands of times makes the time taken to run the algorithm we are developing grow exponentially. Below is the example of the query executed now

var param = new QueryParameters() { Geometry = geometryToIntersec, ReturnGeometry = false, SpatialRelationship = SpatialRelationship.Intersects };
var results = (await featureTable.QueryFeaturesAsync(param).ConfigureAwait(false)).ToList();