Enable pg_stat_statements for PostgreSQL
Modify PostgreSQL Configuration
To enable pg_stat_statements, you need to modify the following PostgreSQL configuration in PostgreSQL configuration file (e.g. /etc/postgresql/12/main/postgresql.conf
):
Restart PostgreSQL
After you change the PostgreSQL configuration, you need to restart PostgreSQL to make the change effective.
Create pg_stat_statements Extension for Each Database
Currently, pg_stat_statements only tracks the statistics of the database where the extension is created. So you need to create the extension for each database.
You can use the Bytebase Batch Change feature to create the extension for all databases.