标签

PostgreSQL , 分区 , 继承 , constraint_exclusion


背景

目前PG社区版本内置分区表的性能受制于一些BIND、LOCK所有子表等问题,当分区过多时,性能会受到极大的影响。

《分区表锁粒度差异 - pg_pathman VS native partition table》

《PostgreSQL 查询涉及分区表过多导致的性能问题 - 性能诊断与优化(大量BIND, spin lock, SLEEP进程)》

不过还好pg_pathman这个插件弥补了以上问题。同时EDB发行的商用PG版本,在分区上面也有一些改进。

社区中,有一些committer关注到了这样的问题,同时提出了一些解法,已经将partition的选择代码进行了改造,采用的方法可能与EDB商用发型版本类似。

第一个相关patch如下

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9fdb675fc5d2de825414e05939727de8b120ae81

Faster partition pruning    Add a new module backend/partitioning/partprune.c, implementing a more
sophisticated algorithm for partition pruning.  The new module uses each
partition's "boundinfo" for pruning instead of constraint exclusion,
based on an idea proposed by Robert Haas of a "pruning program": a list
of steps generated from the query quals which are run iteratively to
obtain a list of partitions that must be scanned in order to satisfy
those quals.    At present, this targets planner-time partition pruning, but there exist
further patches to apply partition pruning at execution time as well.    This commit also moves some definitions from include/catalog/partition.h
to a new file include/partitioning/partbounds.h, in an attempt to
rationalize partitioning related code.    Authors: Amit Langote, David Rowley, Dilip Kumar
Reviewers: Robert Haas, Kyotaro Horiguchi, Ashutosh Bapat, Jesper Pedersen.
Discussion: https://postgr.es/m/098b9c71-1915-1a2a-8d52-1a7a50ce79e8@lab.ntt.co.jp

这个patch还有一些连带的patch,未来社区版本的分区表应该不会再有bind, lock所有分区的问题了。

https://commitfest.postgresql.org/17/1330/

参考

《分区表锁粒度差异 - pg_pathman VS native partition table》

《PostgreSQL 查询涉及分区表过多导致的性能问题 - 性能诊断与优化(大量BIND, spin lock, SLEEP进程)》

《PostgreSQL 商用版本EPAS(阿里云ppas) - 分区表性能优化 (堪比pg_pathman)》

《PostgreSQL 10 内置分区 vs pg_pathman perf profiling》

PostgreSQL 11 preview - Faster partition pruning相关推荐

  1. PostgreSQL 11 preview - bloom filter 误报率评估测试及如何降低误报 - 暨bloom filter应用于HEAP与INDEX的一致性检测...

    标签 PostgreSQL , bloom filter , 误报率 , amcheck 背景 bloom filter是一个空间压缩,概率数据结构,可以存储超容量的数据集,用于判断某个元素是否存在于 ...

  2. PostgreSQL 11 preview - Surjective indexes - 索引HOT增强(表达式)update评估

    标签 PostgreSQL , 表达式索引 , 表达式结果变化评估 , projection function , 多值索引 , GIN , 多值元素变化 背景 PostgreSQL 11马上要提交的 ...

  3. PostgreSQL 11 preview - Allow on-line enabling and disabling of data checksums

    标签 PostgreSQL , checksum , online modify , pg_verify_checksums , pg_enable_data_checksums , pg_disab ...

  4. PostgreSQL 11 新特性之哈希分区

    文章目录 PostgreSQL 10 引入了声明式分区(declarative partitioning)特性,但是实现的功能有限.PostgreSQL 11 为此带来了许多关于分区的增强功能.首先就 ...

  5. PostgreSQL 11 tpcc 测试(103万tpmC on ECS) - use sysbench-tpcc by Percona-Lab

    标签 PostgreSQL , tpcc 背景 环境 阿里云虚拟机 [root@pg11-test ~]# lscpu Architecture: x86_64 CPU op-mode(s): 32- ...

  6. CentOS 7 源码编译安装 PostgreSQL 11.2

    环境 系统版本 Centos7.6 工具:xshell6 PostgreSql: postgresql-11.2.tar.gz 安装部署 安装前准备 官网下载PostgreSQL 11.2源码地址:h ...

  7. PostgreSQL 11 100亿 tpcb 性能测试 on ECS

    标签 PostgreSQL , tpcb , pgbench , 100亿 背景 PostgreSQL 11 发布在即,以下是tpcc与tpch测试的结果: <PostgreSQL 11 tpc ...

  8. PostgreSQL 11 1Kw TPCC , 1亿 TPCB 7*24 强压耐久测试

    标签 PostgreSQL , tpcc , tpcb 背景 TPCC, TPCB是工业标准的OLTP类型业务的数据库测试,包含大量的读.写.更新.删除操作. 7*24小时强压耐久测试,主要看数据库在 ...

  9. 在Ubuntu 18.04上安装PostgreSQL 11和PgAdmin4

    In this guide, you will learn how to install PostgreSQL 11 and PgAdmin4 on Ubuntu 18.04 LTS. 在本指南中,您 ...

  10. PostgreSQL 11 与 pgAdmin4 在 Windows 平台上的安装和使用

    文章目录 1.下载 2.解压后,添加环境配置 3.创建 Database Cluster 4.启动 vs 停止,注册 Windows 服务 5.角色 6.pgAdmin4 7.psql 8.配置远程访 ...

最新文章

  1. UE4 AR开发笔记
  2. 安卓惯性传感器(一)
  3. Synchronize锁重入
  4. 树型列表结构宽度调整_Material Design 网格列表
  5. 将list对象转换为QuerySet对象
  6. 点/线/面 等 几何关系运算 的网页 推荐+备忘
  7. 小米11渲染图曝光:屏下摄像头技术现身还有方形5摄相机模组
  8. 旅游管理系统项目java设计_基于JSP的旅游管理系统设计与实现(MyEclipse,SQL)
  9. 小学生 计算机编程 教程,小学生C++创意编程(视频教学版)
  10. 成为一名初级游戏策划
  11. java jco sap 重连_SAP R3和JAVA交换数据之JCO
  12. 计算机组老师颁奖词,学校优秀老师颁奖词
  13. Linux系统安全及应用详解
  14. 远程桌面 中断计算机连接不上,中断远程桌面连接解决方案
  15. 完善智慧办公建设,小熊U租获京东数千万元A+轮融资
  16. c++直方图匹配终极版,支持任意通道数(opencv版本)
  17. 【GamePlay】UGUI的注意事项
  18. SQL Server 数据库修复专家SQLRescue
  19. 服务器安全神器,Linux 上安装 Fail2Ban 保护 SSH
  20. 计算机科学新技术新应用发展,新技术的发展和应用

热门文章

  1. C语言经典算法100例-021-猴子吃桃问题
  2. 【GCC调试程序C语言问题】对‘ceil’未定义的引用/已经包含头文件仍然提示未定义的引用
  3. IntelliJ IDEA创建Java-Web项目
  4. 特征选择的基本方法概述
  5. 点云能量预测:KPConv点云输入方式
  6. Echarts常用配置参数
  7. android仿IOS,滑动隐藏底部ScrollView
  8. 在Vue+springBoot环境中如何实现单点登录(SSO)
  9. 分享一波大厂面试题,助力大家拿个好Offer
  10. 刚刚,爱奇艺发布重磅开源项目!