From 9e770fc886cbed0cc8f3de97083b653ef1be29f2 Mon Sep 17 00:00:00 2001 From: chenlinfeng <723609220@qq.com> Date: Mon, 19 May 2025 19:29:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=B4=A2=E5=BC=95=E5=8E=8B?= =?UTF-8?q?=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/backend/access/nbtree/nbtutils.c | 8 +++++++- src/backend/storage/buffer/buf_init_ext.c | 2 +- src/backend/utils/cache/relcache.c | 9 +++++++-- src/include/access/nbtree.h | 1 + 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c index 6397688..a990435 100644 --- a/src/backend/access/nbtree/nbtutils.c +++ b/src/backend/access/nbtree/nbtutils.c @@ -2130,7 +2130,13 @@ btoptions(Datum reloptions, bool validate) {"vacuum_cleanup_index_scale_factor", RELOPT_TYPE_REAL, offsetof(BTOptions, vacuum_cleanup_index_scale_factor)}, {"deduplicate_items", RELOPT_TYPE_BOOL, - offsetof(BTOptions, deduplicate_items)} + offsetof(BTOptions, deduplicate_items)}, + {"compress_type", RELOPT_TYPE_INT, + offsetof(BTOptions, compress) + offsetof(PageCompressOpts, compressType)}, + {"compress_level", RELOPT_TYPE_INT, + offsetof(BTOptions, compress) + offsetof(PageCompressOpts, compressLevel)}, + {"compress_chunk_size", RELOPT_TYPE_INT, + offsetof(BTOptions, compress) + offsetof(PageCompressOpts, compressChunkSize)} }; return (bytea *) build_reloptions(reloptions, validate, diff --git a/src/backend/storage/buffer/buf_init_ext.c b/src/backend/storage/buffer/buf_init_ext.c index 3171f73..59aa9ba 100644 --- a/src/backend/storage/buffer/buf_init_ext.c +++ b/src/backend/storage/buffer/buf_init_ext.c @@ -8,7 +8,7 @@ KPHCPciPageBuffCtx *gPciBufCtx = NULL; //Default 8K * 1000 Size KPHCPciBufferSize() { - return 1000 * 1024 * 8; + return (Size)1024 * 1024 * 1024 * 2; } void KPHCPciLruPushNoLock(KPHCPciLruList *lru, KPHCPciPageCtrl *item, KPHCCtrlState state) diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 5a1bcfd..6ceae43 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -1389,8 +1389,13 @@ RelationInitPhysicalAddr(Relation relation) */ relation->rd_node.opt = 0; if (relation->rd_options && REL_SUPPORT_COMPRESSED(relation)) { - SetupPageCompressForRelation(&relation->rd_node, &((StdRdOptions*)(void*)(relation->rd_options))->compress, - RelationGetRelationName(relation)); + if (relation->rd_rel->relkind == 'i') { + SetupPageCompressForRelation(&relation->rd_node, &((BTOptions *)(void*)(relation->rd_options))->compress, + RelationGetRelationName(relation)); + } else { + SetupPageCompressForRelation(&relation->rd_node, &((StdRdOptions*)(void*)(relation->rd_options))->compress, + RelationGetRelationName(relation)); + } } } diff --git a/src/include/access/nbtree.h b/src/include/access/nbtree.h index 3055a5c..c11e33a 100644 --- a/src/include/access/nbtree.h +++ b/src/include/access/nbtree.h @@ -1092,6 +1092,7 @@ typedef struct BTOptions int fillfactor; /* page fill factor in percent (0..100) */ float8 vacuum_cleanup_index_scale_factor; /* deprecated */ bool deduplicate_items; /* Try to deduplicate items? */ + PageCompressOpts compress; } BTOptions; #define BTGetFillFactor(relation) \ -- Gitee