Re: Make tuple deformation faster

Victor Yegorov <vyegorov@gmail.com>

From: Victor Yegorov <vyegorov@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Andres Freund <andres@anarazel.de>, Matthias van de Meent <boekewurm+postgres@gmail.com>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2024-12-02T14:03:55Z
Lists: pgsql-hackers

Attachments

пн, 2 дек. 2024 г. в 13:24, David Rowley <dgrowleyml@gmail.com>:

> I ended up adjusting the code here so that TupleDescSize() returns the
> full size and TupleDescAttrAddress() manually calculates the offset to
> start the FormData_pg_attribute array.  That allows
> TupleDescFullSize() to be deleted.  I changed how TupleDescCopy()
> works as it used to perform the memcpy in 2 parts. I've changed that
> to now perform a single memcpy() and reset the ->attrs field after the
> memcpy so that it correctly points to the address for its own
> TupleDesc rather than the one from the source.
>
>
Nice!


> I've attached a v5 set of patches, which I think addresses everything
> you mentioned.  I've also shuffled the patches around a little to how
> I think they should be committed.
>

I'm glad that the patch from “More tuple deformation speedups” is moved
here, I wanted
to mention that both patches should be committed together.

All is good, and the benefits are clearly visible (same setup used).


-- 
Victor Yegorov

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix possible Assert failure in verify_compact_attribute()

  2. Speedup tuple deformation with additional function inlining

  3. Fix race condition in TupleDescCompactAttr assert code

  4. Optimize alignment calculations in tuple form/deform

  5. Remove pg_attribute.attcacheoff column

  6. Introduce CompactAttribute array in TupleDesc, take 2

  7. Introduce CompactAttribute array in TupleDesc

  8. Use TupleDescAttr macro consistently