Compress (Data Management)
Summary
Compresses an ArcSDE geodatabase by removing states not referenced by a version and redundant rows.
Usage
-
When you delete a record from a database, it is only marked as deleted; it is not actually removed from the associated table. Therefore, the table will remain the same size after you delete records. To actually remove deleted records from the database, you must compress the database.
-
To improve database performance, the database should be compressed periodically.
-
A compressed database is more efficient. A database that is never compressed is more likely to develop errors.
-
Once a database is compressed, deleted records cannot be recovered.
-
Compression of databases not only reduces space requirements but can also reduce overall retrieval times.
-
When the Compress tool is executed, the database is unavailable until compression is completed.
-
Only the SDE administrator can perform compression.
Syntax
Parameter | Explanation | Data Type |
in_workspace |
The ArcSDE database to be compressed. | Workspace |
Code Sample
This stand-alone Python script uses the Compress tool to compress the geodatabase.
import arcpy arcpy.Compress_management("Database Connections\Connection to brockville.sde")