Skip to content

Latest commit

 

History

History
122 lines (83 loc) · 6.41 KB

20240401_01.md

File metadata and controls

122 lines (83 loc) · 6.41 KB

PostgreSQL 17 preview - 频繁提交table access method相关patch, undo-based table access methods真的快来了吗?

作者

digoal

日期

2024-04-01

标签

PostgreSQL , PolarDB , DuckDB , undo-based table access methods


背景

undo-based table access methods真的快来了吗? PostgreSQL 17频繁提交table access method相关功能增强patch.

《PostgreSQL 17 preview - 支持修改分区表access method》

《PostgreSQL 17 preview - 寻找undo-based table access methods的蛛丝马迹》

table AM 增加自定义分析采样接口, 原因是原来的接口仅仅适合heap表架构, 索引组织表的采样方法显然不同.

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=27bc1772fc814946918a5ac8ccb9b5c5ad0380aa

Generalize relation analyze in table AM interface  
author   Alexander Korotkov <akorotkov@postgresql.org>     
Sat, 30 Mar 2024 20:34:04 +0000 (22:34 +0200)  
committer   Alexander Korotkov <akorotkov@postgresql.org>     
Sat, 30 Mar 2024 20:34:04 +0000 (22:34 +0200)  
commit   27bc1772fc814946918a5ac8ccb9b5c5ad0380aa  
tree  beb4fac8dfb2756c86f3ac13ec21d72f69daa55c  tree  
parent   b154d8a6d0e52e5f6b09739639fdf55fa88bc6b8  commit | diff  
Generalize relation analyze in table AM interface  
  
Currently, there is just one algorithm for sampling tuples from a table written  
in acquire_sample_rows().  Custom table AM can just redefine the way to get the  
next block/tuple by implementing scan_analyze_next_block() and  
scan_analyze_next_tuple() API functions.  
  
This approach doesn't seem general enough.  For instance, it's unclear how to  
sample this way index-organized tables.  This commit allows table AM to  
encapsulate the whole sampling algorithm (currently implemented in  
acquire_sample_rows()) into the relation_analyze() API function.  
  
Discussion: https://postgr.es/m/CAPpHfdurb9ycV8udYqM%3Do0sPS66PJ4RCBM1g-bBpvzUfogY0EA%40mail.gmail.com  
Reviewed-by: Pavel Borisov, Matthias van de Meent  

table AM 增加支持reloptions接口.

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

Custom reloptions for table AM  
author   Alexander Korotkov <akorotkov@postgresql.org>     
Sat, 30 Mar 2024 20:36:25 +0000 (22:36 +0200)  
committer   Alexander Korotkov <akorotkov@postgresql.org>     
Sat, 30 Mar 2024 20:36:25 +0000 (22:36 +0200)  
commit   c95c25f9af4bc77f2f66a587735c50da08c12b37  
tree  3f6f97b2ea2acf3de72b953e17ade6f5bc23db6e  tree  
parent   27bc1772fc814946918a5ac8ccb9b5c5ad0380aa  commit | diff  
Custom reloptions for table AM  
  
Let table AM define custom reloptions for its tables.  This allows to  
specify AM-specific parameters by WITH clause when creating a table.  
  
The code may use some parts from prior work by Hao Wu.  
  
Discussion: https://postgr.es/m/CAPpHfdurb9ycV8udYqM%3Do0sPS66PJ4RCBM1g-bBpvzUfogY0EA%40mail.gmail.com  
Discussion: https://postgr.es/m/AMUA1wBBBxfc3tKRLLdU64rb.1.1683276279979.Hmail.wuhao%40hashdata.cn  
Reviewed-by: Reviewed-by: Pavel Borisov, Matthias van de Meent  

table AM 支持接管Insert index的逻辑.

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

Let table AM insertion methods control index insertion master github/master  
author   Alexander Korotkov <akorotkov@postgresql.org>     
Sat, 30 Mar 2024 20:39:03 +0000 (22:39 +0200)  
committer   Alexander Korotkov <akorotkov@postgresql.org>     
Sat, 30 Mar 2024 20:53:56 +0000 (22:53 +0200)  
commit   b1484a3f1910bfd0e254afe40085dfc3351bda8c  
tree  329e9e84dba07d2b85487c4acb5ebb975836947b  tree  
parent   c95c25f9af4bc77f2f66a587735c50da08c12b37  commit | diff  
Let table AM insertion methods control index insertion  
  
Previously, the executor did index insert unconditionally after calling  
table AM interface methods tuple_insert() and multi_insert().  This commit  
introduces the new parameter insert_indexes for these two methods.  Setting  
'*insert_indexes' to true saves the current logic.  Setting it to false  
indicates that table AM cares about index inserts itself and doesn't want the  
caller to do that.  
  
Discussion: https://postgr.es/m/CAPpHfdurb9ycV8udYqM%3Do0sPS66PJ4RCBM1g-bBpvzUfogY0EA%40mail.gmail.com  
Reviewed-by: Pavel Borisov, Matthias van de Meent, Mark Dilger  

digoal's wechat