1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-25 13:17:41 +03:00

vacuumdb: Add option --analyze-in-stages

Add vacuumdb option --analyze-in-stages which runs ANALYZE three times
with different configuration settings, adopting the logic from the
analyze_new_cluster.sh script that pg_upgrade generates.  That way,
users of pg_dump/pg_restore can also use that functionality.

Change pg_upgrade to create the script so that it calls vacuumdb instead
of implementing the logic itself.
This commit is contained in:
Peter Eisentraut
2014-04-14 23:15:05 -04:00
parent 0d3b2b80aa
commit c92c3d50d7
4 changed files with 94 additions and 70 deletions

View File

@@ -0,0 +1,16 @@
use strict;
use warnings;
use TestLib;
use Test::More tests => 1;
my $tempdir = tempdir;
start_test_server $tempdir;
issues_sql_like(['vacuumdb', '--analyze-in-stages', 'postgres'],
qr/.*statement:\ SET\ default_statistics_target=1;\ SET\ vacuum_cost_delay=0;
.*statement:\ ANALYZE.*
.*statement:\ SET\ default_statistics_target=10;\ RESET\ vacuum_cost_delay;
.*statement:\ ANALYZE.*
.*statement:\ RESET\ default_statistics_target;
.*statement:\ ANALYZE/sx,
'analyze three times');