Proper use of Rebuild Indexes and Analyze Datasets tools

17670
20
07-22-2015 09:14 AM
BlakeTerhune
MVP Regular Contributor

I'm trying to build some SDE maintenance Python scripts and found this help document very informative.

ArcGIS Help 10.2 - Using Python scripting to batch reconcile and post versions

However, I noticed that the detailed section on Rebuild Indexes and Analyze Datasets does not uses the NO_SYSTEM option for include_system, but the full example code at the bottom does. Could someone clarify exactly what the include_system option does and which is the recommended way to use it? Maybe a Python​ expert can help?

20 Replies
JonHall
Occasional Contributor II

"One other question ...rebuild index BEFORE you run the Analyze Datasets? 

...run in the other order, directly after compressing the database"?

This is an old question, really 2 or 3 questions. I've been refreshing my memory on this topic. Please correct me if I'm wrong. My answer applies only to SQL Server DBMS.

First, I've had DBAs argue that Analyze Datasets (update statistics) is unnecessary, because SQL Server updates statistics automatically.

As I recall, the answer is that SQL Server may not do it automatically right away, and you may need the possibly improved query performance from update stats sooner than later. Like during COMPRESS.

As I recall, the purpose of rebuilding indexes before analyze datasets (update statistics) is that rebuilt indexes are then considered as part of the analysis of best query performance. 

If your COMPRESS runs fast anyway, you may waste more time Analyzing than you save in Compress speed. , and may actually waste time running Analyze.

As I recall, YES, you should definitely Rebuild Indexes and Analyze Datasets (again, or only) after running Compress. COMPRESS changes the Base tables, and therefore your indexes and statistics may be stale.

0 Kudos