Skip to content

Commit

Permalink
install auto_explain shared library
Browse files Browse the repository at this point in the history
Add install_auto_explain to load the auto_explain shared library.
  • Loading branch information
mw2q authored and hannahms committed Sep 21, 2023
1 parent bdb696e commit 68bceb6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions roles/init_dbserver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ The only dependencies required for this ansible galaxy role are:

When executing the role via ansible there are two required variables:

* ***install_auto_explain***

The `auto_explain` shared library will be loaded `install_auto_explain:
true`. Default: `true`

* ***pg_version***

Postgres Versions supported are: 10, 11, 12, 13, 14 and 15
Expand Down
3 changes: 3 additions & 0 deletions roles/init_dbserver/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ pg_ssl: true
pg_instance_name: main
pg_remote_ssl_src: false

# auto_explain
install_auto_explain: true

# This parameter define if we want to run pg_initdb command on a server or not
run_initdb: true

Expand Down
7 changes: 7 additions & 0 deletions roles/init_dbserver/templates/postgresql.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ log_autovacuum_min_duration = 0
autovacuum_max_workers = 5
autovacuum_vacuum_cost_limit = 3000
idle_in_transaction_session_timeout = 10min
{% if install_auto_explain|bool %}
{{ pg_shared_libraries_list.append('$libdir/auto_explain') }}
auto_explain.log_min_duration = 60
auto_explain.log_analyze = on
auto_explain.log_wal = on
auto_explain.log_timing = on
{% endif %}
{% if enable_edb_repo|bool and install_edb_postgres_tuner|bool and pg_version|int >= 11 %}
{{ pg_shared_libraries_list.append('$libdir/edb_pg_tuner') }}
edb_pg_tuner.autotune = on
Expand Down

0 comments on commit 68bceb6

Please sign in to comment.