Re: Parallel CREATE INDEX for GIN indexes
Tomas Vondra <tomas.vondra@enterprisedb.com>
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: pgsql-hackers@lists.postgresql.org
Cc: Andy Fan <zhihuifan1213@163.com>
Date: 2024-06-24T00:58:16Z
Lists: pgsql-hackers
Attachments
- v20240624-0001-Allow-parallel-create-for-GIN-indexes.patch (text/x-patch) patch v20240624-0001
- v20240624-0002-Use-mergesort-in-the-leader-process.patch (text/x-patch) patch v20240624-0002
- v20240624-0003-Remove-the-explicit-pg_qsort-in-workers.patch (text/x-patch) patch v20240624-0003
- v20240624-0004-Compress-TID-lists-before-writing-tuples-t.patch (text/x-patch) patch v20240624-0004
- v20240624-0005-Collect-and-print-compression-stats.patch (text/x-patch) patch v20240624-0005
- v20240624-0006-Enforce-memory-limit-when-combining-tuples.patch (text/x-patch) patch v20240624-0006
- v20240624-0007-Detect-wrap-around-in-parallel-callback.patch (text/x-patch) patch v20240624-0007
Here's a bit more cleaned up version, clarifying a lot of comments, removing a bunch of obsolete comments, or comments speculating about possible solutions, that sort of thing. I've also removed couple more XXX comments, etc. The main change however is that the sorting no longer relies on memcmp() to compare the values. I did that because it was enough for the initial WIP patches, and it worked till now - but the comments explained this may not be a good idea if the data type allows the same value to have multiple binary representations, or something like that. I don't have a practical example to show an issue, but I guess if using memcmp() was safe we'd be doing it in a bunch of places already, and AFAIK we're not. And even if it happened to be OK, this is a probably not the place where to start doing it. So I've switched this to use the regular data-type comparisons, with SortSupport etc. There's a bit more cleanup remaining and testing needed, but I'm not aware of any bugs. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Exercise parallel GIN builds in regression tests
- f6e5d21bf73f 19 (unreleased) landed
- 32593394ee43 18.2 landed
-
Lookup the correct ordering for parallel GIN builds
- db14dcdec69d 19 (unreleased) landed
- eee71a66cc86 18.2 landed
-
Fix memory leak in _gin_parallel_merge
- 1681a70df3d6 18.0 landed
-
Enforce memory limit during parallel GIN builds
- b229c1016477 18.0 landed
-
Compress TID lists when writing GIN tuples to disk
- 0b2a45a5d1f2 18.0 landed
-
Allow parallel CREATE INDEX for GIN indexes
- 8492feb98f6d 18.0 landed