Skip to main content

Module statistics

Module statistics 

Source
Expand description

Differ for statistics. Per-statistic granular diff:

  • Structural change (columns / kinds / target) → ReplaceStatistic (skip the rest).
  • statistics_target differs → AlterStatisticSetTarget.
  • owner differs (lenient) → AlterObjectOwner.
  • comment differs → CommentOnStatistic.

Lenient: target-only statistics do NOT emit DropStatistic (surfaces via unmanaged-statistic lint in Stage 9).

Spec: docs/superpowers/specs/2026-05-27-statistics-and-check-option-design.md.

Functions§

diff_statistics
Compute granular statistic changes needed to converge target toward source. Appends all emitted changes to out.