暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

PostgreSQL 14 preview - SP-GiST 索引新增 index 叶子结点 include column value 功能 支持

digoal 2021-01-04
433

作者

digoal

日期

2021-04-06

标签

PostgreSQL , include


背景

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=09c1c6ab4bc5764dd69c53ccfd43b2060b1fd090

PostgreSQL 14 索引 include功能新增对SP-GiST 索引的支持.

include功能就是在索引叶子结点中填充其他内容, 例如其他字段的值, 减少回表, 达到类似索引组织表的效果(比索引组织表的好处是它不限于PK维度. 可以在任何索引任何维度include, 达到任意组织的效果).

《PostgreSQL 索引算子下推扩展 - 索引内offset - 索引内过滤 - include index - 随机偏移》

《PostgreSQL index include - 类聚簇表与应用(append only, IoT时空轨迹, 离散多行扫描与返回)》

《PostgreSQL 12 preview - GiST 索引支持INCLUDE columns - 覆盖索引 - 类聚簇索引》

``` Support INCLUDE'd columns in SP-GiST.

author Tom Lane tgl@sss.pgh.pa.us
Mon, 5 Apr 2021 22:41:09 +0000 (18:41 -0400) committer Tom Lane tgl@sss.pgh.pa.us
Mon, 5 Apr 2021 22:41:21 +0000 (18:41 -0400) commit 09c1c6ab4bc5764dd69c53ccfd43b2060b1fd090 tree 0b5eacefe5007d52388f475499b018cccd228c0e tree parent 49f49defe7c0a330cca084de5da14ccdfdafc6a3 commit | diff Support INCLUDE'd columns in SP-GiST.

Not much to say here: does what it says on the tin. We steal a previously-always-zero bit from the nextOffset field of leaf index tuples in order to track whether there is a nulls bitmap. Otherwise it works about like included columns in other index types.

Pavel Borisov, reviewed by Andrey Borodin and Anastasia Lubennikova, and rather heavily editorialized on by me

Discussion: https://postgr.es/m/CALT9ZEFi-vMp4faht9f9Junb1nO3NOSjhpxTmbm1UGLMsLqiEQ@mail.gmail.com ```

PostgreSQL 许愿链接

您的愿望将传达给PG kernel hacker、数据库厂商等, 帮助提高数据库产品质量和功能, 说不定下一个PG版本就有您提出的功能点. 针对非常好的提议,奖励限量版PG文化衫、纪念品、贴纸、PG热门书籍等,奖品丰富,快来许愿。开不开森.

9.9元购买3个月阿里云RDS PostgreSQL实例

PostgreSQL 解决方案集合

德哥 / digoal's github - 公益是一辈子的事.

digoal's wechat

文章转载自digoal,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论