<?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: Reindex GDB Tables in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396019#M45023</link>
    <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/461666"&gt;@KimberleeHermann1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for that tip, I was not sure if the SQL way would be preferable, or the ArcGIS Pro way, but it seems that the SQL way is more preferred! I will give that a shot and go through with it that way, my initial assumption was that since they are ArcGIS Pro provided indexes through GDB functionality, then they could only be rebuilt within Pro, but we learn as we go!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2024 16:14:37 GMT</pubDate>
    <dc:creator>CodyPatterson</dc:creator>
    <dc:date>2024-03-14T16:14:37Z</dc:date>
    <item>
      <title>Reindex GDB Tables</title>
      <link>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1395765#M45020</link>
      <description>&lt;P&gt;Hey All,&lt;/P&gt;&lt;P&gt;Enterprise 11.2 Geodatabase.&lt;/P&gt;&lt;P&gt;I have been reindexing our Enterprise Geodatabase every day, as we write quite often to this DB, and have noticed using a fragmentation query, that we have a few tables that don't seem to reindex, these include GDB_ITEMS and SDE_column_registry. These are unable to be selected via ArcGIS Pro, so I was curious if these should be reindexed, or if these should just be disregarded, they are quite large.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CodyPatterson_0-1710418108124.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/97985iDD8C7987B5B83360/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CodyPatterson_0-1710418108124.png" alt="CodyPatterson_0-1710418108124.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 12:08:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1395765#M45020</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-03-14T12:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reindex GDB Tables</title>
      <link>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396004#M45021</link>
      <description>Hello...if you are using SQL Server it is super easy to use the Maintenance Plan wizard and do a reindex of everything on a database. Usually doesn't take long at all. I have it scheduled for all of my databases each weekend and that seems to keep thing "all good".&lt;BR /&gt;</description>
      <pubDate>Thu, 14 Mar 2024 15:51:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396004#M45021</guid>
      <dc:creator>KimberleeHermann1</dc:creator>
      <dc:date>2024-03-14T15:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Reindex GDB Tables</title>
      <link>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396012#M45022</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/712076"&gt;@CodyPatterson&lt;/a&gt;&amp;nbsp;- I usually avoid using the ArcGIS Pro GP Tools to gather new statistics and to rebuild indexes (attribute indexes and spatial indexes ) in my production geodatabases because these tools to not offer advanced options that you find with the SQL Server SQL Commands to do the same. I suggest you use the SQL Server Tools to do this maintenance.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;You can find my maintenance scripts for SQL Server in my community.esri.com blog below, download the database template scripts for SQL Server.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/mapping-and-charting-enterprise-databases/mapping-and-charting-solutions-mcs-enterprise/ba-p/893351" target="_blank" rel="noopener"&gt;Mapping and Charting Solutions (MCS) Enterprise Da... - Esri Community&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Your question about the GDB_ITEMS table and any other ArcSDE Repository Tables. Yes, those tables must be reindexed as well, probably not every day, as you will not be creating new featureclasses, etc. in the geodatabase, but you should reorganize indexes weekly and rebuild indexes monthly at least for the ArcSDE Repository Tables, and right after that gather new statistics.&lt;BR /&gt;&lt;BR /&gt;For reference to others about this discussion follow below the links for the ArcGIS Pro GP Tools.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-sql-server/enterprise-geodatabase-maintenance.htm" target="_blank" rel="noopener"&gt;Enterprise geodatabase maintenance tasks—ArcGIS Pro | Documentation&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/modifying-a-spatial-index.htm" target="_blank" rel="noopener"&gt;Modify a spatial index—ArcGIS Pro | Documentation&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/rebuild-indexes.htm" target="_blank" rel="noopener"&gt;Rebuild Indexes (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-sql-server/update-statistics.htm" target="_blank" rel="noopener"&gt;Update database statistics—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 16:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396012#M45022</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2024-03-14T16:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Reindex GDB Tables</title>
      <link>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396019#M45023</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/461666"&gt;@KimberleeHermann1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for that tip, I was not sure if the SQL way would be preferable, or the ArcGIS Pro way, but it seems that the SQL way is more preferred! I will give that a shot and go through with it that way, my initial assumption was that since they are ArcGIS Pro provided indexes through GDB functionality, then they could only be rebuilt within Pro, but we learn as we go!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 16:14:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396019#M45023</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-03-14T16:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reindex GDB Tables</title>
      <link>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396024#M45024</link>
      <description>&lt;P&gt;Hey &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/7880"&gt;@MarceloMarques&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the tip! I will check that out to see what I can manage with that! I spoke with another commenter and said that I was not confident on which method to use, since my assumption was that since it's a Pro index, I must do it in Pro, but it looks like that's incorrect.&lt;/P&gt;&lt;P&gt;I appreciate the documentation too!&lt;/P&gt;&lt;P&gt;Cody&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 16:17:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396024#M45024</guid>
      <dc:creator>CodyPatterson</dc:creator>
      <dc:date>2024-03-14T16:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reindex GDB Tables</title>
      <link>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396225#M45025</link>
      <description>&lt;P&gt;You are very welcome!! So glad it worked for you.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 18:58:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1396225#M45025</guid>
      <dc:creator>KimberleeHermann1</dc:creator>
      <dc:date>2024-03-14T18:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reindex GDB Tables</title>
      <link>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1678594#M45824</link>
      <description>&lt;P&gt;Hello all&lt;/P&gt;&lt;P&gt;I am running in similar program.&lt;/P&gt;&lt;P&gt;I use&amp;nbsp;&lt;SPAN&gt;Maintenance Plan to check and index my tables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;When it try to reindex GDB_ITEMS I get this error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ALTER INDEX [R6_pk] ON [sde].[GDB_ITEMS] REORGANIZ..." failed with the following error: "The index "R6_pk" on table "GDB_ITEMS" cannot be reorganized because&lt;BR /&gt;page level locking is disabled."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We did not changed anything in the system tables.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any idea?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jan 2026 11:40:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1678594#M45824</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2026-01-19T11:40:51Z</dc:date>
    </item>
    <item>
      <title>Re: Reindex GDB Tables</title>
      <link>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1678778#M45825</link>
      <description>&lt;P&gt;This is well known, and the change to the indexes was implemented many releases ago when Geodatabase Branch Versioning was introduced. Refer to my earlier reply above for links to my database maintenance scripts.&lt;BR /&gt;&lt;BR /&gt;Examples:&lt;BR /&gt;&lt;BR /&gt;- execute every month - rebuild indexes&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;CREATE PROCEDURE [dbo].[mp_rebuild_indexes_gisgdb] 
  @fillfactor INT = 75
AS
BEGIN
    DECLARE @DbId VARCHAR(255) 
	DECLARE @Database VARCHAR(255)   
	DECLARE @SchemaName VARCHAR(256)
    DECLARE @TableName VARCHAR(256)
    DECLARE @IndexName VARCHAR(256) 
	DECLARE @cmd NVARCHAR(500) 
	--DECLARE @fillfactor INT = 75

	DECLARE DatabaseCursor CURSOR LOCAL FORWARD_ONLY STATIC READ_ONLY FOR  
	SELECT dbid, name FROM master.dbo.sysdatabases   
	WHERE name NOT IN ('master','msdb','tempdb','model')
	AND name = 'gisgdb'
	ORDER BY 1  

	OPEN DatabaseCursor  

	FETCH NEXT FROM DatabaseCursor INTO @DbId,@Database  
	WHILE @@FETCH_STATUS = 0  
	BEGIN  

	  PRINT ('DB: '+ @Database)
	  SET @cmd = 'USE ' + @Database + ';'
	  PRINT (@cmd)
	  EXEC (@cmd) 
	  PRINT ('Indexes allow_page_locks = 1')
	  --Indexes allow_page_locks = 1	
      SET @cmd = 'DECLARE IndexCursor CURSOR FOR SELECT OBJECT_SCHEMA_NAME(t.object_id,' + @DbId +') schema_name, t.name table_name,  i.name index_name
	  FROM ' + @Database + '.sys.indexes i
      INNER JOIN ' + @Database + '.sys.tables t ON t.object_id= i.object_id
      WHERE i.allow_page_locks = 1 AND t.Name IS NOT NULL AND i.name IS NOT NULL'

	  -- create index cursor  
	   PRINT (@cmd)
	   EXEC (@cmd)  
	   OPEN IndexCursor   

	   FETCH NEXT FROM IndexCursor INTO @SchemaName,@TableName,@IndexName   
	   WHILE @@FETCH_STATUS = 0   
	   BEGIN   
           PRINT ('Index_Name: ' + @Database + '.' + @SchemaName + '.' + @TableName + '.' + @IndexName)
		   BEGIN TRY
			   --SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' REBUILD WITH (FILLFACTOR = ' + CONVERT(VARCHAR(3),@fillfactor) + ')' 
			   SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' REBUILD;'
			   PRINT @cmd
			   EXEC (@cmd) 
		   END TRY
		   BEGIN CATCH
			   PRINT 'This is the error: ' + error_message()
		   END CATCH
		   FETCH NEXT FROM IndexCursor INTO @SchemaName,@TableName,@IndexName   
	   END   
	   CLOSE IndexCursor   
	   DEALLOCATE IndexCursor 
 
      PRINT ('Indexes allow_page_locks = 0')
	  --Indexes allow_page_locks = 0 	
      SET @cmd = 'DECLARE IndexCursor CURSOR FOR SELECT OBJECT_SCHEMA_NAME(t.object_id,' + @DbId + ') schema_name, t.name table_name,  i.name index_name
	  FROM ' + @Database + '.sys.indexes i
      INNER JOIN ' + @Database + '.sys.tables t ON t.object_id= i.object_id
      WHERE i.allow_page_locks = 0 AND t.Name IS NOT NULL AND i.name IS NOT NULL'

	   -- create index cursor  
	   PRINT (@cmd)
	   EXEC (@cmd)  
	   OPEN IndexCursor   

	   FETCH NEXT FROM IndexCursor INTO @SchemaName,@TableName,@IndexName   
	   WHILE @@FETCH_STATUS = 0   
	   BEGIN   
           PRINT ('Index_Name: ' + @Database + '.' + @SchemaName + '.' + @TableName + '.' + @IndexName)
		   BEGIN TRY
			   SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' SET (ALLOW_PAGE_LOCKS = ON);'
			   PRINT @cmd
			   EXEC (@cmd)
			   --SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' REBUILD WITH (FILLFACTOR = ' + CONVERT(VARCHAR(3),@fillfactor) + ')' 
			   SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' REBUILD;'
			   PRINT @cmd
			   EXEC (@cmd) 
			   SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' SET (ALLOW_PAGE_LOCKS = OFF);'
			   PRINT @cmd
			   EXEC (@cmd)
		   END TRY
		   BEGIN CATCH
			   PRINT 'This is the error: ' + error_message()
		   END CATCH
		   FETCH NEXT FROM IndexCursor INTO @SchemaName,@TableName,@IndexName   
	   END   
	   CLOSE IndexCursor   
	   DEALLOCATE IndexCursor  
	   FETCH NEXT FROM DatabaseCursor INTO @DbId,@Database  
	END  
	CLOSE DatabaseCursor   
	DEALLOCATE DatabaseCursor
END
GO&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;- execute every week - reorganize indexes&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;CREATE PROCEDURE [dbo].[mp_reorganize_indexes]
AS
BEGIN
    DECLARE @DbId VARCHAR(255) 
	DECLARE @Database VARCHAR(255)   
	DECLARE @SchemaName VARCHAR(256)
    DECLARE @TableName VARCHAR(256)
    DECLARE @IndexName VARCHAR(256) 
	DECLARE @cmd NVARCHAR(500) 

	DECLARE DatabaseCursor CURSOR LOCAL FORWARD_ONLY STATIC READ_ONLY FOR  
	SELECT dbid, name FROM master.dbo.sysdatabases   
	WHERE name NOT IN ('master','msdb','tempdb','model')
	--AND name = 'topo2'
	ORDER BY 1  

	OPEN DatabaseCursor  

	FETCH NEXT FROM DatabaseCursor INTO @DbId,@Database  
	WHILE @@FETCH_STATUS = 0  
	BEGIN  

	  PRINT ('DB: '+ @Database)
	  SET @cmd = 'USE ' + @Database + ';'
	  PRINT (@cmd)
	  EXEC (@cmd) 
	  PRINT ('Indexes allow_page_locks = 1')
	  --Indexes allow_page_locks = 1	
      SET @cmd = 'DECLARE IndexCursor CURSOR FOR SELECT OBJECT_SCHEMA_NAME(t.object_id,' + @DbId +') schema_name, t.name table_name,  i.name index_name
	  FROM ' + @Database + '.sys.indexes i
      INNER JOIN ' + @Database + '.sys.tables t ON t.object_id= i.object_id
      WHERE i.allow_page_locks = 1 AND t.Name IS NOT NULL AND i.name IS NOT NULL'

	  -- create index cursor  
	   PRINT (@cmd)
	   EXEC (@cmd)  
	   OPEN IndexCursor   

	   FETCH NEXT FROM IndexCursor INTO @SchemaName,@TableName,@IndexName   
	   WHILE @@FETCH_STATUS = 0   
	   BEGIN   
           PRINT ('Index_Name: ' + @Database + '.' + @SchemaName + '.' + @TableName + '.' + @IndexName)
		   BEGIN TRY
			   SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' REORGANIZE  WITH ( LOB_COMPACTION = ON );'
			   PRINT @cmd
			   EXEC (@cmd) 
		   END TRY
		   BEGIN CATCH
			   PRINT 'This is the error: ' + error_message()
		   END CATCH
		   FETCH NEXT FROM IndexCursor INTO @SchemaName,@TableName,@IndexName   
	   END   
	   CLOSE IndexCursor   
	   DEALLOCATE IndexCursor 
 
      PRINT ('Indexes allow_page_locks = 0')
	  --Indexes allow_page_locks = 0 	
      SET @cmd = 'DECLARE IndexCursor CURSOR FOR SELECT OBJECT_SCHEMA_NAME(t.object_id,' + @DbId + ') schema_name, t.name table_name,  i.name index_name
	  FROM ' + @Database + '.sys.indexes i
      INNER JOIN ' + @Database + '.sys.tables t ON t.object_id= i.object_id
      WHERE i.allow_page_locks = 0 AND t.Name IS NOT NULL AND i.name IS NOT NULL'

	   -- create index cursor  
	   PRINT (@cmd)
	   EXEC (@cmd)  
	   OPEN IndexCursor   

	   FETCH NEXT FROM IndexCursor INTO @SchemaName,@TableName,@IndexName   
	   WHILE @@FETCH_STATUS = 0   
	   BEGIN   
           PRINT ('Index_Name: ' + @Database + '.' + @SchemaName + '.' + @TableName + '.' + @IndexName)
		   BEGIN TRY
			   SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' SET (ALLOW_PAGE_LOCKS = ON);'
			   PRINT @cmd
			   EXEC (@cmd) 
			   SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' REORGANIZE  WITH ( LOB_COMPACTION = ON );'
			   PRINT @cmd
			   EXEC (@cmd) 
			   SET @cmd = 'ALTER INDEX ' + @IndexName + ' ON ' + @Database + '.' + @SchemaName + '.' + @TableName + ' SET (ALLOW_PAGE_LOCKS = OFF);'
			   PRINT @cmd
			   EXEC (@cmd)
		   END TRY
		   BEGIN CATCH
			   PRINT 'This is the error: ' + error_message()
		   END CATCH
		   FETCH NEXT FROM IndexCursor INTO @SchemaName,@TableName,@IndexName   
	   END   
	   CLOSE IndexCursor   
	   DEALLOCATE IndexCursor  
	   FETCH NEXT FROM DatabaseCursor INTO @DbId,@Database  
	END  
	CLOSE DatabaseCursor   
	DEALLOCATE DatabaseCursor
END
GO&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2026 16:55:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/reindex-gdb-tables/m-p/1678778#M45825</guid>
      <dc:creator>MarceloMarques</dc:creator>
      <dc:date>2026-01-20T16:55:01Z</dc:date>
    </item>
  </channel>
</rss>

