From: Sarah Hoffmann Date: Thu, 24 Aug 2023 08:38:06 +0000 (+0200) Subject: postgresql: add seq_scan_cost setting X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/05f3e1b7375f9c67f5e7a48b327e62b037f03554 postgresql: add seq_scan_cost setting --- diff --git a/cookbooks/postgresql/attributes/default.rb b/cookbooks/postgresql/attributes/default.rb index 88942aa6f..1123f4f1a 100644 --- a/cookbooks/postgresql/attributes/default.rb +++ b/cookbooks/postgresql/attributes/default.rb @@ -28,6 +28,7 @@ default[:postgresql][:settings][:defaults][:max_wal_senders] = "10" default[:postgresql][:settings][:defaults][:max_replication_slots] = "10" default[:postgresql][:settings][:defaults][:hot_standby] = "on" default[:postgresql][:settings][:defaults][:hot_standby_feedback] = "off" +default[:postgresql][:settings][:defaults][:seq_page_cost] = "1.0" default[:postgresql][:settings][:defaults][:random_page_cost] = "4.0" default[:postgresql][:settings][:defaults][:cpu_tuple_cost] = "0.01" default[:postgresql][:settings][:defaults][:effective_cache_size] = "4GB" diff --git a/cookbooks/postgresql/templates/default/postgresql.conf.erb b/cookbooks/postgresql/templates/default/postgresql.conf.erb index a8bc83c05..9fba27e6e 100644 --- a/cookbooks/postgresql/templates/default/postgresql.conf.erb +++ b/cookbooks/postgresql/templates/default/postgresql.conf.erb @@ -104,6 +104,7 @@ hot_standby_feedback = <%= @settings[:hot_standby_feedback] || @defaults[:hot_st # - Planner Cost Constants - +seq_page_cost = <%= @settings[:seq_page_cost] || @defaults[:seq_page_cost] %> random_page_cost = <%= @settings[:random_page_cost] || @defaults[:random_page_cost] %> cpu_tuple_cost = <%= @settings[:cpu_tuple_cost] || @defaults[:cpu_tuple_cost] %> effective_cache_size = <%= @settings[:effective_cache_size] || @defaults[:effective_cache_size] %>