Skip to content

Parallel CREATE INDEX for GIN indexes #114

@grantzhou

Description

@grantzhou

--- As of 2026-01-26T23:33:55.000Z ---

Tomas Vondra pushed both patches to fix a bug in tuplesort_begin_index_gin() that incorrectly used btree comparison functions instead of GIN opclass compare functions. The first patch corrects this issue where the function looked up the key type's btree operator rather than the GIN opclass's compare function, potentially causing problems if no btree opclass exists or if btree/gin opclasses disagree on ordering. The second patch improves test coverage for parallel GIN index builds by tweaking regression tests to build GIN indexes in parallel. Both patches were backpatched to PostgreSQL 18. The issue was initially reported through code coverage analysis that showed parallel GIN builds weren't adequately tested, unlike btree parallel builds which are covered by existing tests.
Tomas Vondra推送了两个补丁来修复tuplesort_begin_index_gin()中的bug,该bug错误地使用了btree比较函数而不是GIN操作类的比较函数。第一个补丁修正了这个问题,即函数查找键类型的btree操作符而不是GIN操作类的比较函数,如果不存在btree操作类或btree/gin操作类在排序上不一致,可能会导致问题。第二个补丁通过调整回归测试以并行构建GIN索引,改善了并行GIN索引构建的测试覆盖率。两个补丁都已回溯到PostgreSQL 18。该问题最初是通过代码覆盖率分析报告的,分析显示并行GIN构建没有得到充分测试,不像btree并行构建已被现有测试覆盖。

participants - 参与者:

Metadata

Metadata

Assignees

No one assigned

    Labels

    hacker discussionshacker discussions summarized by PGNexus Agent

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions