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:
16
src/bin/scripts/t/102_vacuumdb_stages.pl
Normal file
16
src/bin/scripts/t/102_vacuumdb_stages.pl
Normal 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');
|
||||
Reference in New Issue
Block a user