diff options
author | Nathan Bossart <nathan@postgresql.org> | 2025-02-04 15:07:54 -0600 |
---|---|---|
committer | John Naylor <john.naylor@postgresql.org> | 2025-03-07 10:17:35 +0700 |
commit | 5f8eb25706b62923c53172e453c8a4dedd877a3d (patch) | |
tree | cb293d4335eeb54b12153444b267b28eaba3465e /src/test/perl/PostgreSQL/Test/Cluster.pm | |
parent | e2080261cc8c1a962708843dc4c806e19fb2c44e (diff) | |
download | postgresql-5f8eb25706b62923c53172e453c8a4dedd877a3d.tar.gz postgresql-5f8eb25706b62923c53172e453c8a4dedd877a3d.zip |
vacuumdb: Add option for analyzing only relations missing stats.
This commit adds a new --missing-only option that can be used in
conjunction with --analyze-only and --analyze-in-stages. When this
option is specified, vacuumdb will generate ANALYZE commands for a
relation if it is missing any statistics it should ordinarily have.
For example, if a table has statistics for one column but not
another, we will analyze the whole table. A similar principle
applies to extended statistics, expression indexes, and table
inheritance.
Co-authored-by: Corey Huinker <corey.huinker@gmail.com>
Reviewed-by: TODO
Discussion: https://postgr.es/m/Z5O1bpcwDrMgyrYy%40nathan
Diffstat (limited to 'src/test/perl/PostgreSQL/Test/Cluster.pm')
-rw-r--r-- | src/test/perl/PostgreSQL/Test/Cluster.pm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/perl/PostgreSQL/Test/Cluster.pm b/src/test/perl/PostgreSQL/Test/Cluster.pm index b105cba05a6..ff8e04d3a03 100644 --- a/src/test/perl/PostgreSQL/Test/Cluster.pm +++ b/src/test/perl/PostgreSQL/Test/Cluster.pm @@ -2820,6 +2820,33 @@ sub issues_sql_like =pod +=item $node->issues_sql_unlike(cmd, unexpected_sql, test_name) + +Run a command on the node, then verify that $unexpected_sql does not appear in +the server log file. + +=cut + +sub issues_sql_unlike +{ + local $Test::Builder::Level = $Test::Builder::Level + 1; + + my ($self, $cmd, $unexpected_sql, $test_name) = @_; + + local %ENV = $self->_get_env(); + + my $log_location = -s $self->logfile; + + my $result = PostgreSQL::Test::Utils::run_log($cmd); + ok($result, "@$cmd exit code 0"); + my $log = + PostgreSQL::Test::Utils::slurp_file($self->logfile, $log_location); + unlike($log, $unexpected_sql, "$test_name: SQL not found in server log"); + return; +} + +=pod + =item $node->log_content() Returns the contents of log of the node |