Re: brininsert optimization opportunity
Tomas Vondra <tomas.vondra@enterprisedb.com>
From: Tomas Vondra <tomas.vondra@enterprisedb.com>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>,
Soumyadeep Chakraborty <soumyadeep2007@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>,
Ashwin Agrawal <ashwinstar@gmail.com>
Date: 2023-07-04T11:59:21Z
Lists: pgsql-hackers
On 7/4/23 13:23, Alvaro Herrera wrote: > On 2023-Jul-03, Soumyadeep Chakraborty wrote: > >> My colleague, Ashwin, pointed out to me that brininsert's per-tuple init >> of the revmap access struct can have non-trivial overhead. >> >> Turns out he is right. We are saving 24 bytes of memory per-call for >> the access struct, and a bit on buffer/locking overhead, with the >> attached patch. > > Hmm, yeah, I remember being bit bothered by this repeated > initialization. Your patch looks reasonable to me. I would set > bistate->bs_rmAccess to NULL in the cleanup callback, just to be sure. > Also, please add comments atop these two new functions, to explain what > they are. > > Nice results. > Yeah. I wonder how much of that runtime is the generate_series(), though. What's the speedup if that part is subtracted. It's guaranteed to be even more significant, but by how much? 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