<?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 Re: Arcpy - Rebuild indexes in file geodatabase in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375887#M29709</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because the data is updated regularly in this database&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Dec 2019 19:36:46 GMT</pubDate>
    <dc:creator>MaximeDemers</dc:creator>
    <dc:date>2019-12-04T19:36:46Z</dc:date>
    <item>
      <title>Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375881#M29703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to automatize the rebuild of file geodatabase indexes using arcpy v10.6, but I encounter an &lt;STRONG&gt;ERROR 000837 &lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;The workspace is not the correct workspace type.&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Why? Does arcpy.RebuildIndexes_management() works only with Enterprise geodatabases? Then, how to rebuild indexes in file geodatabases?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Thank you&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; os

workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:/tmp/myDatabase.gdb"&lt;/SPAN&gt;
fc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MyFeatureClass"&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Exists&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;join&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;RebuildIndexes_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NO_SYSTEM"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ALL"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="operator token"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;ERROR &lt;SPAN class="number token"&gt;000837&lt;/SPAN&gt; The workspace &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; the correct workspace type&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:22:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375881#M29703</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2021-12-11T17:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375882#M29704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you run the tool manually on the fgdb?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2019 18:04:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375882#M29704</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-04T18:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375883#M29705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It seems that you can only use that tool with Enterprise geodatabase because the first parameter in the toolbox accepts only .sde files...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2019 18:11:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375883#M29705</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2019-12-04T18:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375884#M29706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what it looks like to me as well...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/10.6/manage-data/geodatabases/rebuilding-dataset-indexes.htm" title="https://desktop.arcgis.com/en/arcmap/10.6/manage-data/geodatabases/rebuilding-dataset-indexes.htm"&gt;Rebuild dataset indexes using the Rebuild Indexes tool—ArcGIS Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2019 18:12:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375884#M29706</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-04T18:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375885#M29707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then, the solution would be to drop and recreate the indexes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2019 18:14:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375885#M29707</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2019-12-04T18:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375886#M29708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just have to ask: What's the end game?&amp;nbsp; Why do you need your indexes rebuilt?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2019 18:31:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375886#M29708</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-12-04T18:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375887#M29709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because the data is updated regularly in this database&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2019 19:36:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375887#M29709</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2019-12-04T19:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375888#M29710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You just use the ArcTool &lt;STRONG&gt;arcpy.management.AddSpatialIndex()&lt;/STRONG&gt;. The help explains it will rebuild an existing index. Since the indexing is simpler you don't need to specify the spatial grid sizes. I have done this after loading data into a large featureclass and it makes a huge difference to drawing speed and processing.&lt;/P&gt;&lt;P&gt;If processes appear to hang it is always worthwhile to interrupt the process, rebuild the indexes (including attribute indexes) and restart the process. Never be happy with any tool that takes longer than a cup of coffee. Find a better way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that you need to ensure that your features are small and contiguous relative to the full extent. If you have a large 'Mozilla' feature such as an enclosing coastline or large area punctuated with 'holes' representing forest you will defeat the spatial indexing. This is what the &lt;STRONG&gt;DICE&lt;/STRONG&gt; tool is for, to split up unreasonably large polygons.&lt;/P&gt;&lt;P&gt;The same applies to polylines. A single line representing a national highway included with short local roads will make all processes that use an index be very slow. Also do not be tempted to dissolve by a single attribute to 'normalize' the attribute table where one zone is represented by thousands of multi-part polygons.&lt;/P&gt;&lt;P&gt;Running processing across a network is likely to be very slow. Process locally, which means: extract, process, replace.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Dec 2019 22:21:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375888#M29710</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2019-12-12T22:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375889#M29711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the great explanations. It's very useful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have another question about indexes, maybe you could answer it...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you copy a file geodatabase using arcpy.CopyManagement() or when publishing a service to ArcGIS Server Enterprise and data are copied, does the indexes are recreated or just copied as is?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Dec 2019 13:24:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375889#M29711</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2019-12-13T13:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy - Rebuild indexes in file geodatabase</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375890#M29712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this is a bit late but when using file gdb's you can only add and delete an attribute index, not rebuild it (unless you use the above cheat with the spatial index &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;). The arcpy functions to do these operations can be found here: &lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/an-overview-of-the-indexes-toolset.htm" title="https://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/an-overview-of-the-indexes-toolset.htm"&gt;An overview of the Indexes toolset—ArcMap | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 Sep 2020 23:29:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-rebuild-indexes-in-file-geodatabase/m-p/375890#M29712</guid>
      <dc:creator>MarkVolz1</dc:creator>
      <dc:date>2020-09-20T23:29:48Z</dc:date>
    </item>
  </channel>
</rss>

