7 Contrib Modules
PDF page 89
Describes new features related to the Contrib modules.
3.5.1 Auto_explain
The following features have been added to the auto_explain: [d4bfe41, 9d2d972]
Parameter log_parameter_max_length
Add the log_parameter_max_length parameter. This parameter limits the maximum log output width. The default value is -1, which imposes no limit. Specifying 0 for this parameter disables logging.
Output of the query ID
The query ID is output if the parameter auto_explain.log_verbose is set to ‘on’ and compute_query_id is set to ‘on’.
3.5.2 Fuzzystrmatch
The daitch_mokotoff function has been added to the fuzzystrmatch module. This function is superior to the SOUNDEX function for non-English languages. [a290378]
PDF page 90
3.5.3 Ltree
Hyphens (-) are now allowed in labels. Previously, only letters, numbers, and underlines (_) were permitted. The maximum label size has been increased from 255 to 1,000 characters. [b1665bf]
3.5.4 Pageinspect
The following features have been added to the pageinspect: [1fd3dd2, 3581cbd, 428c0ca]
Bt_multi_page_stats function
Add function bt_multi_page_stats to print B-Tree index page summaries. This function is the multipage version of the bt_page_stats function. Specify the first block number and number of pages.
Brin_page_items function
The “empty” column has been added to the output of the brin_page_items function to indicate free blocks.
3.5.5 Pg_buffercache
The following functions have been added to the pg_buffercache module. [f3fa313, f3fa313]
PDF page 91
Pg_buffercache_summary function
Add the pg_buffercache_summary function that can check buffer cache summary by SQL statement.
| Column name | Description | Note |
|---|---|---|
| buffers_usedbuffers_unusedbuffers_dirtybuffers_pinnedusagecount_avg | Total number of buffers used Number of free buffers Number of dirty buffers Number of pinned buffers Average amount of dirty buffers used |
Pg_buffercache_usage_counts function
Returns a summary of the state of all shared buffers. It is easier to check the information than by aggregating the pg_buffercache view.
PDF page 92
3.5.6 Pg_stat_statements
Updated how SQL statements are generalized. SET statements, CHECKPOINT statements, CREATE statements, etc. are collected as the same query ID regardless of case. [9ba37b2, daa8365]
3.5.7 Pg_walinspect
Add the pg_get_wal_block_info function. This function extracts a full-page image between specified LSNs. [c31cf1c, 9ecb134, 122376f]
Syntax 17 - Pg_get_wal_block_info function
PDF page 93
| Column name | Data type | Description | Note |
|---|---|---|---|
| start_lsn | pg_lsn | Start LSN | |
| end_lsn | pg_lsn | End LSN | |
| prev_lsn | pg_lsn | Previous LSN | |
| block_id | smallint | Block ID | |
| reltablespacereldatabase | oid | OID of the tablespace | |
| oid | OID of the database | ||
| relfilenoderelforknumber | oid | OID of the relation file node | |
| smallint | Relation fork number | ||
| relblocknumberxid | bigint | Block number of the table | |
| xid | Transaction ID | ||
| resource_managerrecord_type | text | Resource manager name | |
| text | WAL record type | ||
| record_lengthmain_data_length | integer | WAL record length | |
| integer | Main data length | ||
| block_data_lengthblock_fpi_length | integer | Block data length | |
| integer | Block FPI data length | ||
| block_fpi_infodescription | text[] | Block FPI information | |
| text | Description | ||
| block_datablock_fpi_data | bytea | Block data | |
| bytea | FPI data |
PDF page 94
3.5.8 Postgres_fdw
The following enhancements have been implemented in the postgres_fdw module. [97da482, 8ad51b5, 983ec23]
COPY FROM statement
The COPY FROM statement now uses the foreign table’s batch_size option. Below is the log using the log_statement parameter for the instance that owns the table. It can be confirmed that multiple records are inserted in batch.
Analyze_sampling option
The analyze_sampling option has been added to FOREIGN SERVER and FOREIGN TABLE. Previous versions fetched the entire foreign table record for statistics. The load on the remote database can be reduced by using the TABLESAMPLE clause when retrieving information from external tables. The default value is auto, which is assumed to be random for PostgreSQL < 9.5 and bernoulli for PostgreSQL 9.5 and higher. The values that can be set are as follows.
| auto | version (default value) |
|---|---|
| random | Sampling is done using the random function. |
| system | Sampling is done using the TABLESAMPLE SYSTEM clause. |
| bernoulli | Sampling is done using the TABLESAMPLE BERNOULLI clause. |
Value Description Off Do not sample.
PDF page 95
Parallel_abort option
Postgres_fdw aborts remote transactions one at a time if it aborts the local transaction. Setting the option parallel_abort to ’true’ aborts remote transactions in parallel, improving performance. The default value for this option is ‘false’.