作者
digoal
日期
2022-02-08
标签
PostgreSQL , gist , sorted build method
《PostgreSQL 14 preview - gist和sp-gist索引AM支持sort接口, 大幅加速GiST和SP-GiST 索引build速度》
这个特性提升了build gist,sp-gist索引的速度, 但是这种方法build的索引容易出现root、branch节点页面数据的overlap, 导致搜索时精准度下降, 需要更多的内部filter, 从而降低查询性能.
PostgreSQL 优化了sorted build method , 解决索引采用sorted build方法后索引性能下降的问题.
+Sorted build method +------------------- + +Sort all input tuples, pack them into GiST leaf pages in the sorted order, +and create downlinks and internal pages as we go. This method builds the index +from the bottom up, similar to how the B-tree index is built. + +The sorted method is used if the operator classes for all columns have a +"sortsupport" defined. Otherwise, we fall back on inserting tuples one by one +with optional buffering. + +Sorting GiST build requires good linearization of the sort opclass. That is not +always the case in multidimensional data. To tackle the anomalies, we buffer +index tuples and apply a picksplit function that can be multidimensional-aware. +
复制
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=f1ea98a7975e15cefdb446385880a2f55224ee7d
Reduce non-leaf keys overlap in GiST indexes produced by a sorted build author Alexander Korotkov <akorotkov@postgresql.org> Mon, 7 Feb 2022 20:20:42 +0000 (23:20 +0300) committer Alexander Korotkov <akorotkov@postgresql.org> Mon, 7 Feb 2022 20:20:42 +0000 (23:20 +0300) commit f1ea98a7975e15cefdb446385880a2f55224ee7d tree 8efc57dc7b2480397fc838baa0dd328630f611b6 tree parent 42a9e88bf6a809e6023c9d50f58cc6b9446f229d commit | diff Reduce non-leaf keys overlap in GiST indexes produced by a sorted build The GiST sorted build currently chooses split points according to the only page space utilization. That may lead to higher non-leaf keys overlap and, in turn, slower search query answers. This commit makes the sorted build use the opclass's picksplit method. Once four pages at the level are accumulated, the picksplit method is applied until each split partition fits the page. Some of our split algorithms could show significant performance degradation while processing 4-times more data at once. But those opclasses haven't received the sorted build support and shouldn't receive it before their split algorithms are improved. Discussion: https://postgr.es/m/CAHqSB9jqtS94e9%3D0vxqQX5dxQA89N95UKyz-%3DA7Y%2B_YJt%2BVW5A%40mail.gmail.com Author: Aliaksandr Kalenik, Sergei Shoulbakov, Andrey Borodin Reviewed-by: Björn Harrtell, Darafei Praliaskouski, Andres Freund Reviewed-by: Alexander Korotkov
复制
期望 PostgreSQL 增加什么功能?
PolarDB for PostgreSQL云原生分布式开源数据库
PostgreSQL 解决方案集合
德哥 / digoal's github - 公益是一辈子的事.
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
外国CTO也感兴趣的开源数据库项目——openHalo
小满未满、
1245次阅读
2025-04-21 16:58:09
9.9 分高危漏洞,尽快升级到 pgAdmin 4 v9.2 进行修复
严少安
382次阅读
2025-04-11 10:43:23
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
366次阅读
2025-04-15 14:48:05
openHalo问世,全球首款基于PostgreSQL兼容MySQL协议的国产开源数据库
严少安
356次阅读
2025-04-07 12:14:29
转发有奖 | PostgreSQL 16 PGCM高级认证课程直播班招生中!
墨天轮小教习
173次阅读
2025-04-14 15:58:34
SQL 优化之 OR 子句改写
xiongcc
123次阅读
2025-04-21 00:08:06
融合Redis缓存的PostgreSQL高可用架构
梧桐
109次阅读
2025-04-08 06:35:40
PostgreSQL拓展PGQ实现解析
chirpyli
107次阅读
2025-04-07 11:23:17
中国PostgreSQL培训认证体系新增PGAI应用工程师方向
开源软件联盟PostgreSQL分会
92次阅读
2025-05-06 10:21:13
PostgreSQL的dblink扩展模块使用方法
szrsu
90次阅读
2025-04-24 17:39:30
热门文章
阿里巴巴的使命、愿景、核心价值观
2021-01-04 67728浏览
MacOS 关闭和开启虚拟内存(swap)
2022-01-20 17859浏览
[珍藏级] PostgreSQL ssl 证书配置 - 防止中间攻击者 - 以及如何使用证书无密码登录配置cert
2020-06-19 16541浏览
PostgreSQL md5hash插件 - 128bit 存储,压缩空间、提升效率
2019-11-08 14372浏览
产品与运营-OKR的设计、总结、复盘、规划、组织保障和考核例子
2022-01-20 13336浏览
最新文章
PostgreSQL 15 preview - PostgreSQL 15 pg_stat_statements 增加对temp file blocks io timing的统计, 增加JIT的统计.
2022-01-20 270浏览
德说-第92期, 怎么解决躺平|不想奋斗?
2022-01-20 301浏览
PostgreSQL 增量物化视图插件 - pg_ivm incremental materialized view maintenance
2022-01-20 1406浏览
PostgreSQL 15 preview - ARM多核适配 性能提升 - Use ISB as a spin-delay instruction on ARM64
2022-01-20 793浏览
PostgreSQL 15 preview - recovery(包括崩溃恢复、逻辑流复制、物理流复制、归档恢复) 加速, 支持异步prefetch 预读接下来要恢复的wal record相关的data block到shared buffer
2022-01-20 1223浏览