Noticeable slowdown while retrieving a feature using IFeatureClass.GetFeature() from a versioned data rather than from a non-versioned data.
上次发布: August 25, 2014ArcSDE/Enterprise Geodatabase
漏洞 ID 编号
NIM050922
已提交
November 10, 2009
上次修改时间
June 5, 2024
适用范围
ArcSDE/Enterprise Geodatabase
找到的版本
9.3.1
编程语言
All
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
No Public Explanation
解决办法
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(); }