Join us for our webinar on June 25th, 10:00am Pacific Time: Postgres plan monitoring and management - register now.

Step 3: Review auto_explain settings

There are a number of auto_explain settings that allow you to configure which queries will generate EXPLAIN plans. You can read the full Postgres documentation about these here. The right configuration will depend on your server and workload, but we’ve found the following is a good starting point:

SettingRecommended
auto_explain.log_formatjson
auto_explain.log_min_duration1000
auto_explain.log_analyzeon
auto_explain.log_bufferson
auto_explain.log_timingoff
auto_explain.log_triggerson
auto_explain.log_verboseon
auto_explain.log_nested_statementson
auto_explain.sample_rate1

Summary of required changes

auto_explain.log_format
json
auto_explain.log_min_duration
1000

Summary of recommended changes

auto_explain.log_analyze
on
auto_explain.log_buffers
on
auto_explain.log_timing
off
auto_explain.log_triggers
on
auto_explain.log_verbose
on
auto_explain.log_nested_statements
on
auto_explain.sample_rate
1

Apply the settings above as Google Cloud SQL / AlloyDB flags for your database:

Configure auto_explain for your Google Cloud SQL / AlloyDB database

After you save the parameter group changes, proceed to the next step:

Proceed to Step 4: Test and verify


Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →