Re: Parallel CREATE INDEX for BRIN indexes
Tomas Vondra <tomas.vondra@enterprisedb.com>
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Andres Freund <andres@anarazel.de>
Cc: Matthias van de Meent <boekewurm+postgres@gmail.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-04-13T21:04:33Z
Lists: pgsql-hackers
Attachments
- v20240413-0001-Update-nbits_set-in-brin_bloom_union.patch (text/x-patch) patch v20240413-0001
- v20240413-0002-Use-correct-PG_DETOAST_DATUM-macro-in-BRIN.patch (text/x-patch) patch v20240413-0002
- v20240413-0003-Add-regression-tests-for-BRIN-parallel-bui.patch (text/x-patch) patch v20240413-0003
- v20240413-0004-add-minmax-multi-to-the-regression-test.patch (text/x-patch) patch v20240413-0004
On 4/13/24 11:19, Tomas Vondra wrote: > On 4/13/24 10:36, Andres Freund wrote: >> Hi, >> >> While preparing a differential code coverage report between 16 and HEAD, one >> thing that stands out is the parallel brin build code. Neither on >> coverage.postgresql.org nor locally is that code reached during our tests. >> > > Thanks for pointing this out, it's definitely something that I need to > improve (admittedly, should have been part of the patch). I'll also look > into eliminating the difference between BTREE and BRIN parallel builds, > mentioned in my last message in this thread. > Here's a couple patches adding a test for the parallel CREATE INDEX with BRIN. The actual test is 0003/0004 - I added the test to pageinspect, because that allows cross-checking the index to one built without parallelism, which I think is better than just doing CREATE INDEX without properly testing it produces correct results. It's not entirely trivial because for some opclasses (e.g. minmax-multi) the results depend on the order in which values are added, and order in which summaries from different workers are merged. Funnily enough, while adding the test, I ran into two pre-existing bugs. One is that brin_bloom_union forgot to update the number of bits set in the bitmap, another one is that 6bcda4a721 changes PG_DETOAST_DATUM to the _PACKED version, which however does the wrong thing. Both of which are mostly harmless - it only affects the output function, which is unused outside pageinspect. No impact on query correctness etc. The test needs a bit more work to make sure it works on 32-bit machines etc. which I think may affect available space on a page, which in turn might affect the minmax-multi summaries. But I'll take care this early next week. Funnily -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
Remove incidental md5() function use from test
- 47b47a5617fa 17.0 landed
- 95b856de23c7 18.0 landed
-
Cleanup parallel BRIN index build code
- 0c2f5552d5d4 17.0 landed
-
Stabilize test of BRIN parallel create
- 0bd4b0689ba1 17.0 landed
- 4d916dd876c3 17.0 landed
-
Revert "Stabilize test of BRIN parallel create"
- a89cd7bfcdbb 17.0 landed
-
Add regression test for BRIN parallel builds
- 8225c2fd40cd 17.0 landed
-
Use the correct PG_DETOAST_DATUM macro in BRIN
- 8cea358b128f 16.3 landed
- bb616ed3e6a2 17.0 landed
-
Update nbits_set in brin_bloom_union
- ad23af83dad3 14.12 landed
- 3cd4135119be 15.7 landed
- ccd8f0fa1e54 16.3 landed
- 2f20ced1eb53 17.0 landed
-
Fix parallel BRIN builds with synchronized scans
- cb44a8345e7c 17.0 landed
-
Allow parallel CREATE INDEX for BRIN indexes
- b43757171470 17.0 landed
-
Add empty BRIN ranges during CREATE INDEX
- dae761a87eda 17.0 landed