View statistics_top_ten_block_writes_queries
Top ten queries by block writes.
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. |
| shared_buffer_written | bigint | This is the number of shared blocks written into shared buffer and written to disk. |
| shared_buffer_read | bigint | This is the read is the count of times disk blocks had to be read into memory, which indicates actual I/O operations. High values in shared_blks_read suggest that these queries are the most I/O intensive, which can be a starting point for performance optimization. |
| query | text | This is the SQL source of the query. |
Example
SELECT *
FROM statistics_top_ten_time_consuming_queries;
| rolename | database_name | shared_buffer_written | shared_buffer_read | query |
|---|---|---|---|---|
| stefanie | pgsql_tweaks_test | 11 | 0 | CREATE TABLE test_gap_fill(id INTEGER, some_value text) |
| stefanie | pgsql_tweaks_test | 10 | 0 | CREATE EXTENSION pg_stat_statements |