View statistics_top_ten_wal_records_generated_queries
Top ten queries by WAL records generated, works on primary only.
COUTION
The schema where the extension pg_stat_statements is installed has to be in the search_path of the user!
This view needs pg_stat_statements to be installed. When the extension is not installed, the view will not be installed by the extension.
Columns
| Column Name | datatype | Description |
|---|---|---|
| rolename | regrole | The role/user who executed the query. |
| database_name | name | The database name in which the query has been executed. |
| wal_records | bigint | This is the total number of WAL records generated by the query. |
| query | text | This is the SQL source of the query. |
Example
SELECT *
FROM statistics_top_ten_time_consuming_queries;
| rolename | database_name | wal_records | query |
|---|---|---|---|
| stefanie | postgres | 12330 | CREATE DATABASE pgsql_tweaks_test |
| stefanie | pgsql_tweaks_test | 1051 | CREATE EXTENSION IF NOT EXISTS pg_stat_statements |