You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sql/opt: add data-driven test framework for canary statistics
This commit introduces testing infrastructure for the canary statistics
feature. Previously, there was no systematic way to test the canary
statistics selection logic and the stats_as_of functionality. The
implementation adds a new data-driven test framework in
`pkg/sql/opt/memo/statistics_builder_test.go` that supports commands
for setting canary fraction, stats-as-of timestamps, and making
statistics.
The motivation for adding this test infrastructure is to unit-test the
canary full statistics rollout logic in
`statisticsBuilder.makeTableStatistics()`. While end-to-end testing can
be accomplished via `EXPLAIN ANALYZE` statements, such logictests would
also be influenced by `Builder.maybeAnnotateWithEstimates()`, which
performs its own filtering of full statistics. This dedicated test
infrastructure isolates the testing of the `makeTableStatistics` logic
to ensure the canary selection behavior can be verified independently.
Release note: None
0 commit comments