From 3e501740de4ef25575b9fa5a93562f48dcd55da2 Mon Sep 17 00:00:00 2001 From: Oleksii Kliukin Date: Thu, 12 Oct 2023 09:47:16 +0200 Subject: [PATCH 1/2] Reduce default_statistics_target to 100. This project set it to 500 previously, without evidences that such a high value is really needed. A PostgreSQL default of 100 will improve the planner resources usage, as well as speed up autovacuum/autoanalyze. The user can set the higher value per-table if they need it. --- pkg/pgtune/misc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/pgtune/misc.go b/pkg/pgtune/misc.go index a63bb30..629d211 100644 --- a/pkg/pgtune/misc.go +++ b/pkg/pgtune/misc.go @@ -21,7 +21,7 @@ const ( EffectiveIOKey = "effective_io_concurrency" // linux only checkpointDefault = "0.9" - statsTargetDefault = "500" + statsTargetDefault = "100" randomPageCostDefault = "1.1" autovacuumMaxWorkersDefault = "10" autovacuumNaptimeDefault = "10" From f3aa53ee6b813634a4e63da45b26800758cef6b1 Mon Sep 17 00:00:00 2001 From: Oleksii Kliukin Date: Thu, 12 Oct 2023 09:57:19 +0200 Subject: [PATCH 2/2] Update the test --- pkg/tstune/tuner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/tstune/tuner_test.go b/pkg/tstune/tuner_test.go index 02bba49..514098e 100644 --- a/pkg/tstune/tuner_test.go +++ b/pkg/tstune/tuner_test.go @@ -1420,7 +1420,7 @@ var ( "wal_buffers = 16MB", "min_wal_size = 512MB", "max_wal_size = 1GB", - "default_statistics_target = 500", + "default_statistics_target = 100", "random_page_cost = 1.1", "checkpoint_completion_target = 0.9", fmt.Sprintf("max_connections = %d", testMaxConns),