Describes new features related to the Contrib module.
3.5.1 auto_explain
Auto_explain.log_level parameter
The parameter auto_explain.log_level (default value LOG) has been added. This parameter can specify the level of log output by the auto_explain module. Previously, it was fixed at log level LOG.
Example 99log_level parameter
postgres=# LOAD 'auto_explain' ;
LOAD
postgres=# SET auto_explain.log_level = NOTICE ;
SET
postgres=# SET auto_explain.log_min_duration = 0 ;
SET
postgres=# SELECT * FROM data1 WHERE c1=1000 ;
NOTICE: duration: 146.234 ms plan:
Query Text: SELECT * FROM data1 WHERE c1=1000 ;
Index Scan using data1_pkey on data1 (cost=0.42..8.44 rows=1
width=12)
Index Cond: (c1 = '1000'::numeric)
c1 | c2
------+-------
1000 | data1
(1 row)
Auto_explain.log_settings parameter
Determines whether changed optimizer-related parameters are output to the log. The default value is ‘off’, so no log is output.
The pg_stat_statements_reset function of the pg_stat_statements module has added a parameter that limits the deletion range of statistical information. Statistical information can be deleted by specifying database ID, user ID, and query ID. If these parameters are omitted (the default value is 0), all statistics will be discarded as before.
Example 104pg_stat_statements_reset function
postgres=> \dfS pg_stat_statements_reset
List of functions
-[ RECORD 1 ]-------+--------------------------------------------
-------------
Schema | public
Name | pg_stat_statements_reset
Result data type | void
Argument data types | userid oid DEFAULT 0, dbid oid DEFAULT 0,
queryid bigint DEFAULT 0
Type | func
Also, this function cannot be executed by users who hold the pg_read_all_stats role.
PDF page 85
3.5.5 postgres_fdw
The postgres_fdw module adds an “options” option that specifies the GUC options that can be run in a remote session. For example, settings of work_mem parameter and geqo parameter can be changed. Set values are described in the “-c parameter name = value” format. When specifying multiple parameters, specify the entire “-c parameter_name = value” separated by a space.
Example 105options parameter
postgres=# CREATE SERVER remsvr1 FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host 'remhost1', options '-c work_mem=4MB') ;
CREATE SERVER
postgres=# ALTER SERVER remsvr1 OPTIONS
(SET options '-c work_mem=16MB -c geqo=off') ;
ALTER SERVER
postgres=# SELECT * FROM pg_foreign_server ;
-[ RECORD 1 ]-------------------------------------------------------
srvname | remsvr1
srvowner | 10
srvfdw | 16412
srvtype |
srvversion |
srvacl |
srvoptions | {host=remhost1, "options=-c work_mem=16MB -c geqo=off"}