Re: Reduce memory overheads for storing a Memoize tuple

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Reduce memory overheads for storing a Memoize tuple
Date: 2026-08-05 05:23:30
Message-ID: CAApHDvpsZS=TyC3kRx1B2etSHxevgmoGjhXoR3U2O3rv=vHSVA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 3 Aug 2026 at 16:52, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> wrote:
> The optimized data structure looks good to me. The test result on my side exactly matches yours: 3583kB vs. 2801kB. I had to turn off hash join, otherwise the planner always chose a parallel hash join.

Thanks for looking and checking.

> I have only one nitpick. MAXALIGN(sizeof(MinimalTuple)) appears 4 times. Would it make sense to define a macro for it, say MEMOIZE_TUPLE_LINK_SIZE?

Good idea. Here's a new patch with that adjustment made.

David

Attachment Content-Type Size
v2-0001-Reduce-memory-overheads-for-storing-a-Memoize-tup.patch application/octet-stream 9.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ayush Tiwari 2026-08-05 05:23:58 Backup manifests accept out-of-range LSNs
Previous Message Koshino Taiki 2026-08-05 05:17:08 Define MXID acronym in documentation