Re: brininsert optimization opportunity
Tomas Vondra <tomas.vondra@enterprisedb.com>
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Soumyadeep Chakraborty <soumyadeep2007@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>,
pgsql-hackers <pgsql-hackers@postgresql.org>,
Ashwin Agrawal <ashwinstar@gmail.com>
Date: 2023-11-03T18:35:26Z
Lists: pgsql-hackers
Attachments
- v6-0001-Reuse-revmap-and-brin-desc-in-brininsert.patch (text/x-patch) patch v6-0001
Hi, I took a look at this patch today. I had to rebase the patch, due to some minor bitrot related to 9f0602539d (but nothing major). I also did a couple tiny cosmetic tweaks, but other than that the patch seems OK. See the attached v6. I did some simple performance tests too, similar to those in the initial message: CREATE UNLOGGED TABLE heap (i int); CREATE INDEX ON heap USING brin(i) WITH (pages_per_range=1); -- TRUNCATE heap; INSERT INTO heap SELECT 1 FROM generate_series(1, 20000000); And the results look like this (5 runs each): master: 16448.338 16066.473 16039.166 16067.420 16080.066 patched: 13260.065 13229.800 13254.454 13265.479 13273.693 So that's a nice improvement, even though enabling WAL will make the relative speedup somewhat smaller. The one thing I'm not entirely sure about is adding new stuff to the IndexAmRoutine. I don't think we want to end up with too many callbacks that all AMs have to initialize etc. I can't think of a different/better way to do this, though. Barring objections, I'll try to push this early next week, after another round of cleanup. 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 →
-
Add missing index_insert_cleanup calls
- 41d2c6f952ed 17.0 landed
-
Fix a couple typos in BRIN code
- 95d14b7ae26d 17.0 landed
-
Check if ii_AmCache is NULL in aminsertcleanup
- a82ee7ef3aac 17.0 landed
-
Use fipshash in brin_multi test
- 86b64bafc19c 17.0 cited
-
Reuse BrinDesc and BrinRevmap in brininsert
- c1ec02be1d79 17.0 landed
-
Consider fillfactor when estimating relation size
- 29cf61ade3f2 17.0 cited
-
Postpone some stuff out of ExecInitModifyTable.
- c5b7ba4e67ae 14.0 cited