SQL Server data compression with Protheus
Inventories compression before evaluating benefit and cost.
Overview
Row/page data compression differs from compressing backup files or running shrink. The 2021 TOTVS guidance discusses PAGE for Protheus; Microsoft explains that I/O savings can require more CPU and depend on objects and workload. Evaluate edition, version, temporary space, log and maintenance window in the actual environment. The example only reads partition metadata: it rebuilds no indexes and changes no recovery model. No savings percentage is guaranteed. (TOTVS, 2021, ref. 1; MICROSOFT, n.d., ref. 2)
Commented example
-- Read-only inventory; use the selected test database.
SELECT OBJECT_SCHEMA_NAME(p.object_id) AS schema_name,
OBJECT_NAME(p.object_id) AS table_name,
p.index_id, p.partition_number, p.data_compression_desc
FROM sys.partitions AS p
JOIN sys.tables AS t ON t.object_id = p.object_id
WHERE t.is_ms_shipped = 0
ORDER BY schema_name, table_name, p.index_id, p.partition_number;Lists state per visible object/index/partition; the example compresses nothing. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Compare CPU, reads, duration and space on a representative sample. Do not apply blanket scripts or change recovery model without a DBA plan and backup/restore validation.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.