Step 1: Check for auto_explain
The recommended Automated EXPLAIN configuration for Google Cloud SQL and AlloyDB is to use
auto_explain contrib module. This ensures accurate and detailed plan
information, including runtime information (as gathered by EXPLAIN ANALYZE). With our
recommended configuration (presented in a later step), performance overhead is minimal.
First, to check if
auto_explain is already enabled on your system, run the following
query as user with the
SELECT setting, pending_restart FROM pg_settings WHERE name = 'shared_preload_libraries';
auto_explain is included in the
shared_preload_libraries value and
is false, the module is already enabled.
A Postgres restart will be required to enable the
If a restart is not acceptable for this server right now, you can instead try our alternate
log-based EXPLAIN mechanism. You can switch to the
at any time in the future by turning off the
enable_log_explain collector setting and
auto_explain setup instructions here.
auto_explain is already enabled, you can skip the next step and proceed to
review our recommended
auto_explain configuration settings:
Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →