From 08760606467ab3e03288085d394b3d3a9e81f3b9 Mon Sep 17 00:00:00 2001 From: lkhhfd1 <1356915765@qq.com> Date: Fri, 27 Nov 2026 13:46:24 +0800 Subject: [PATCH 1/3] docs(v5.6): correct createdb --maintenance-db description in Chinese reference (#592) --- CN/modules/ROOT/pages/9.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CN/modules/ROOT/pages/9.adoc b/CN/modules/ROOT/pages/9.adoc index 2432ee47..d61ca1be 100644 --- a/CN/modules/ROOT/pages/9.adoc +++ b/CN/modules/ROOT/pages/9.adoc @@ -232,7 +232,7 @@ createdb也接受下列命令行参数用于连接参数: - `--maintenance-db=*dbname*` -指定要连接到来发现哪些其他数据库应该被聚簇的数据库名。如果没有指定,将使用 `postgres` 数据库。而如果它也不存在(或者如果它就是要创建新数据库的名称),将使用 `template1`。这可以是 http://www.postgresql.org/docs/17/libpq-connect.html#LIBPQ-CONNSTRING[connection string]。如果是这样,连接时字符串参数将覆盖所有冲突的命令行选项。 +指定在创建新数据库时要连接到的数据库名。如果没有指定,将使用 `postgres` 数据库。而如果它也不存在(或者如果它就是要创建新数据库的名称),将使用 `template1`。这可以是 http://www.postgresql.org/docs/17/libpq-connect.html#LIBPQ-CONNSTRING[connection string]。如果是这样,连接时字符串参数将覆盖所有冲突的命令行选项。 ==== 环境 From b495ff790351bad5cc6f54d86cfdde703346d0b0 Mon Sep 17 00:00:00 2001 From: lkhhfd1 <1356915765@qq.com> Date: Tue, 1 Dec 2026 20:57:32 +0800 Subject: [PATCH 2/3] docs: correct the generated ROWID sequence cache example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both language versions of the RowID architecture page showed the generated sequence always receiving NOCACHE. In IvorySQL 5.6 the sequence generator reads ivorysql.rowid_seq_cache (default 20) and uses CACHE when the value is > 1, NOCACHE only when it is 1 — for both CREATE TABLE and ALTER TABLE ... SET WITH ROWID. Update the code excerpt to the real conditional logic and state the default CACHE 20 behaviour, with source references. closes #529 Assisted-by: LLM Signed-off-by: lkhhfd1 <1356915765@qq.com> --- EN/modules/ROOT/pages/6.3.3.adoc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/EN/modules/ROOT/pages/6.3.3.adoc b/EN/modules/ROOT/pages/6.3.3.adoc index c5cb7f52..275c12d3 100644 --- a/EN/modules/ROOT/pages/6.3.3.adoc +++ b/EN/modules/ROOT/pages/6.3.3.adoc @@ -36,12 +36,22 @@ When the RowID functionality is enabled via the GUC parameter, or by the WITH RO (Node *) makeTypeNameFromOid(INT8OID, -1), -1), seqstmt->options); - seqstmt->options = lcons(makeDefElem("nocache", + if (rowid_seq_cache > 1) + { + seqstmt->options = lcons(makeDefElem("cache", + (Node *) makeInteger(rowid_seq_cache), + -1), + seqstmt->options); + } + else + seqstmt->options = lcons(makeDefElem("nocache", NULL, -1), seqstmt->options); ``` +The cache option comes from `ivorysql.rowid_seq_cache`, whose default is `20`. With the default, the generated sequence uses `CACHE 20`; only when the parameter is set to `1` does the generator use `NOCACHE`. This applies both to the sequence created with a new table and to `ALTER TABLE … SET WITH ROWID`. + To enable fast querying of a row using the RowID pseudo-column, a `UNIQUE` index is automatically created on the RowID column of the table by default to provide efficient query performance. The implementation of the RowID column as a system attribute column is achieved by adding a new system column in heap.c. From 6250e96219c10c86b20df1d615f893ea4444bcbf Mon Sep 17 00:00:00 2001 From: lkhhfd1 <1356915765@qq.com> Date: Tue, 1 Dec 2026 20:57:34 +0800 Subject: [PATCH 3/3] docs: sync CN RowID cache example --- CN/modules/ROOT/pages/6.3.3.adoc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CN/modules/ROOT/pages/6.3.3.adoc b/CN/modules/ROOT/pages/6.3.3.adoc index 5cb41417..c04927b5 100644 --- a/CN/modules/ROOT/pages/6.3.3.adoc +++ b/CN/modules/ROOT/pages/6.3.3.adoc @@ -36,12 +36,22 @@ RowID 应当具备以下特性: (Node *) makeTypeNameFromOid(INT8OID, -1), -1), seqstmt->options); - seqstmt->options = lcons(makeDefElem("nocache", + if (rowid_seq_cache > 1) + { + seqstmt->options = lcons(makeDefElem("cache", + (Node *) makeInteger(rowid_seq_cache), + -1), + seqstmt->options); + } + else + seqstmt->options = lcons(makeDefElem("nocache", NULL, -1), seqstmt->options); ``` +cache 选项来自 `ivorysql.rowid_seq_cache`,默认值为 `20`。因此默认生成的序列使用 `CACHE 20`;只有当该参数设为 `1` 时才会使用 `NOCACHE`。这一行为同时适用于建表时创建的序列和 `ALTER TABLE … SET WITH ROWID` 创建的序列。 + 同时为了快速通过RowID伪列查询到一行数据,默认会在表的RowID列上创建一个UNIQUE索引,以提供快速查询功能。 RowID列作为系统属性列其实现是通过在 heap.c 中新增一个系统列来实现的。