<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic The low efficiency of cursor in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/the-low-efficiency-of-cursor/m-p/333810#M8705</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If the number of blue code segment is odd, the finally time is more than 1000ms; if the number of blue code segment is even, the finally time is about 50ms.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the red and blue code segment, if dont't get Detach's returned valueï¼? the the finally time is about 50ms&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the reason?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I develop in VC++ 6.0, use ArcGIS 9.3, Oracle 10g&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureClassPtr ipFeatureClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureWorkspace-&amp;gt;OpenFeatureClass(CComBSTR("POINT"), &amp;amp;ipFeatureClass);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IQueryFilterPtr ipQueryFilter(CLSID_SpatialFilter);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ISpatialFilterPtr ipSpatialFilter;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipSpatialFilter = ipQueryFilter;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IEnvelopePtr ipEnvelope(CLSID_Envelope);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipEnvelope-&amp;gt;PutCoords(418500,143700,418950,144000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;putref_Geometry(IGeometryPtr(ipEnvelope));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;put_SpatialRel(esriSpatialRelEnvelopeIntersects );&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BSTR strFieldName;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureClass-&amp;gt;get_ShapeFieldName(&amp;amp;strFieldName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;put_GeometryField(strFieldName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureCursorPtr ipFeatureCursor;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureClass-&amp;gt;Search(ipQueryFilter, VARIANT_FALSE, &amp;amp;ipFeatureCursor); &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureCursorPtr ipTempCursor;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;ipTempCursor = ipFeatureCursor-&amp;gt;Detach();&lt;BR /&gt;ipTempCursor-&amp;gt;Release();&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IEnvelopePtr ipEnvelope2(CLSID_Envelope);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipEnvelope2-&amp;gt;PutCoords(418770,143850,418790,143890);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;putref_Geometry(IGeometryPtr(ipEnvelope2));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;put_GeometryField(strFieldName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;put_SpatialRel(esriSpatialRelEnvelopeIntersects );&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureClass-&amp;gt;Search(ipQueryFilter, VARIANT_FALSE, &amp;amp;ipFeatureCursor);&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;ipTempCursor = ipFeatureCursor-&amp;gt;Detach();&lt;BR /&gt;ipTempCursor-&amp;gt;Release();&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DWORD dStart = GetTickCount();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureClass-&amp;gt;Search(ipQueryFilter, VARIANT_FALSE, &amp;amp;ipFeatureCursor);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DWORD dEnd = GetTickCount();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeaturePtr ipFeature;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;long lCount = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureCursor-&amp;gt;NextFeature(&amp;amp;ipFeature);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while (hr == S_OK)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureCursor-&amp;gt;NextFeature(&amp;amp;ipFeature);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lCount++;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DWORD dValue = dEnd - dStart;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CString str;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;str.Format("%ld,Countï¼?%ld", dValue, lCount);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AfxMessageBox(str);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Jul 2010 12:29:27 GMT</pubDate>
    <dc:creator>szcszc</dc:creator>
    <dc:date>2010-07-21T12:29:27Z</dc:date>
    <item>
      <title>The low efficiency of cursor</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/the-low-efficiency-of-cursor/m-p/333810#M8705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If the number of blue code segment is odd, the finally time is more than 1000ms; if the number of blue code segment is even, the finally time is about 50ms.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the red and blue code segment, if dont't get Detach's returned valueï¼? the the finally time is about 50ms&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is the reason?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I develop in VC++ 6.0, use ArcGIS 9.3, Oracle 10g&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureClassPtr ipFeatureClass;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureWorkspace-&amp;gt;OpenFeatureClass(CComBSTR("POINT"), &amp;amp;ipFeatureClass);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IQueryFilterPtr ipQueryFilter(CLSID_SpatialFilter);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ISpatialFilterPtr ipSpatialFilter;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ipSpatialFilter = ipQueryFilter;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IEnvelopePtr ipEnvelope(CLSID_Envelope);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipEnvelope-&amp;gt;PutCoords(418500,143700,418950,144000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;putref_Geometry(IGeometryPtr(ipEnvelope));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;put_SpatialRel(esriSpatialRelEnvelopeIntersects );&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BSTR strFieldName;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureClass-&amp;gt;get_ShapeFieldName(&amp;amp;strFieldName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;put_GeometryField(strFieldName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureCursorPtr ipFeatureCursor;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureClass-&amp;gt;Search(ipQueryFilter, VARIANT_FALSE, &amp;amp;ipFeatureCursor); &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeatureCursorPtr ipTempCursor;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;ipTempCursor = ipFeatureCursor-&amp;gt;Detach();&lt;BR /&gt;ipTempCursor-&amp;gt;Release();&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IEnvelopePtr ipEnvelope2(CLSID_Envelope);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipEnvelope2-&amp;gt;PutCoords(418770,143850,418790,143890);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;putref_Geometry(IGeometryPtr(ipEnvelope2));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;put_GeometryField(strFieldName);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipSpatialFilter-&amp;gt;put_SpatialRel(esriSpatialRelEnvelopeIntersects );&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureClass-&amp;gt;Search(ipQueryFilter, VARIANT_FALSE, &amp;amp;ipFeatureCursor);&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;ipTempCursor = ipFeatureCursor-&amp;gt;Detach();&lt;BR /&gt;ipTempCursor-&amp;gt;Release();&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DWORD dStart = GetTickCount();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureClass-&amp;gt;Search(ipQueryFilter, VARIANT_FALSE, &amp;amp;ipFeatureCursor);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DWORD dEnd = GetTickCount();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IFeaturePtr ipFeature;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;long lCount = 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureCursor-&amp;gt;NextFeature(&amp;amp;ipFeature);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while (hr == S_OK)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;hr = ipFeatureCursor-&amp;gt;NextFeature(&amp;amp;ipFeature);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;lCount++;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;DWORD dValue = dEnd - dStart;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CString str;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;str.Format("%ld,Countï¼?%ld", dValue, lCount);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;AfxMessageBox(str);&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Jul 2010 12:29:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/the-low-efficiency-of-cursor/m-p/333810#M8705</guid>
      <dc:creator>szcszc</dc:creator>
      <dc:date>2010-07-21T12:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: The low efficiency of cursor</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/the-low-efficiency-of-cursor/m-p/333811#M8706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How to deal with cursor , remain hign efficiency always�?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jul 2010 02:24:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/the-low-efficiency-of-cursor/m-p/333811#M8706</guid>
      <dc:creator>szcszc</dc:creator>
      <dc:date>2010-07-22T02:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: The low efficiency of cursor</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/the-low-efficiency-of-cursor/m-p/333812#M8707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If the data isn't versioned, there is no proplem of search efficiency, but if the data is versioned, the efficiency of cursor appears.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Will&amp;nbsp; the&amp;nbsp; version function affect the&amp;nbsp; efficiency of cursor?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jul 2010 00:31:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/the-low-efficiency-of-cursor/m-p/333812#M8707</guid>
      <dc:creator>szcszc</dc:creator>
      <dc:date>2010-07-27T00:31:05Z</dc:date>
    </item>
  </channel>
</rss>

