PostgreSQL DBA(141) - PG 12(Discovering less-known PostgreSQL v12 features)

本节介绍了PostgreSQL 12中“鲜为人知”的改进。

“Automatic” performance improvements
“Automatic” performance improvements亦即大版本升级时“自然”会带来的性能提升。
Automatic inlining of common table expressions (CTEs)
这个改进先前也介绍过了,在极端情况下可获得极大的性能提升。

Allow parallelized queries when in SERIALIZABLE isolation mode
在SERIALIZABLE隔离模式下允许并行查询。

Enable Just-in-Time (JIT) compilation by default
PG 11或先前版本,默认不启用JIT,在12开始默认启用。

developer changes
PG 12中与开发相关的改进
Support for the SQL/JSON path language
该特性先前也介绍过了,PG 12新增的SQL/JSON,极大提升了“好用性”。

Allow foreign keys to reference partitioned tables
可以允许外键参考分区表,先前版本不支持。

Add partition introspection functions
简化分区管理,PG 12提供了数个数据字典用于查询分区信息,包括pg_partition_root(), pg_partition_ancestors()和pg_partition_tree()

Add connection parameter tcp_user_timeout to control libpq’s TCP timeout
在网络环境较差的情况下,增加tcp_user_timeout参数避免因为网络连接等原因导致的hang情况。

Show the manual page URL in psql’s “\h[elp]” output for a SQL command
帮助信息有所改进,有兴趣的不妨\h对比看看PG 11和PG 12

Allow VACUUM to skip index cleanup
通过禁用index cleanup提升VACUUM性能。

Add EXPLAIN option SETTINGS to output non-default optimizer settings
对于影响执行计划的参数,如有修改,则通过指定该参数显示修改后的配置参数。

Allow logging of statements from only a percentage of transactions
新增了log_transaction_sample_rate参数来实现此功能。对于希望从日志信息得到实际的SQL但又不想过分影响性能,该功能适用于这些场景。

DBA changes
DBA方面的改进
Cause recovery to advance to the latest timeline by default
默认从current修改为latest,众望所归。

Parallel automatic index rebuilding
使用REINDEX CONCURRENTLY并行执行索引重建。

The “pg_checksums” utility can now enable/disable page checksums for an offline cluster
“pg_checksums”工具可以禁用/启用page checksum。

Allow values produced by queries to be assigned to pgbench variables
查询中的返回结果值可用于赋值给pgbench中的变量。

参考资料
Discovering less-known PostgreSQL v12 features

请使用浏览器的分享功能分享到微信等