laptop and a wrench

Bug

Noticeable slowdown while retrieving a feature using IFeatureClass.GetFeature() from a versioned data rather than from a non-versioned data.

Last Published: August 25, 2014 ArcSDE/Enterprise Geodatabase
Bug ID Number NIM050922
SubmittedNovember 10, 2009
Last ModifiedJune 5, 2024
Applies toArcSDE/Enterprise Geodatabase
Version found9.3.1
Program languageAll
StatusWill Not Be Addressed

Additional Information

No Public Explanation

Workaround

Suggested to use IGeodatabsebridge::Getfeatures to get a featurecursor instead of IfeatureClass.getfeature(), which run much faster In both versioned and in non-versioned data. But User was not able to implement this suggestion in his code because it will be affecting his production code.Code suggested:private static void TestGetFeature4() { int[] ids = new int[NUM_TRIALS]; int id = 1; for (int i = 0; i < NUM_TRIALS; i++) { ids[i] = id + i; } IWorkspaceFactory workspaceFactory = new SdeWorkspaceFactory(); IFeatureWorkspace ws = (IFeatureWorkspace)workspaceFactory.OpenFromFile(GEODATABASE_PATH, Win32.GetDesktopWindow()); Console.WriteLine("Opened SDE Geodatbase"); IFeatureClass featureClass = ws.OpenFeatureClass("sde.SDE.USPlaces_Ver"); Int16 featurecount = (short)featureClass.FeatureCount(null); Console.WriteLine("Got " + featureClass.AliasName + " With " + featurecount.ToString() + " features"); IGeoDatabaseBridge2 gdbHelp = new GeoDatabaseHelperClass(); IFeatureCursor fcur = gdbHelp.GetFeatures(featureClass, ref ids, true); long totalTime = 0; Int64 start = Environment.TickCount; IFeature feat = fcur.NextFeature(); totalTime += (Environment.TickCount - start); while (feat != null) { System.Diagnostics.Debug.WriteLine(feat.OID); start = Environment.TickCount; feat = fcur.NextFeature(); totalTime += (Environment.TickCount - start); } Console.WriteLine("total time in Miliseconds: " + totalTime); double avgTime = (double)totalTime / (double)NUM_TRIALS; Console.WriteLine("average time in Miliseconds: " + avgTime); Int32 count = Console.Read(); }

Steps to Reproduce

Bug ID: NIM050922

Software:

  • ArcSDE/Enterprise Geodatabase

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options