Re: pgsql: TupleHashTable: store additional data along with tuple.

From: Junwang Zhao <zhjwpku(at)gmail(dot)com>
To: Jeff Davis <jdavis(at)postgresql(dot)org>
Cc: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: TupleHashTable: store additional data along with tuple.
Date: 2025-01-11 10:18:50
Message-ID: CAEG8a3LQCQy+d_QqvX0hr1AzN0AThpS-9o2urNkE5HQ0rgjTfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Hi Jeff,

On Sat, Jan 11, 2025 at 9:32 AM Jeff Davis <jdavis(at)postgresql(dot)org> wrote:
>
> TupleHashTable: store additional data along with tuple.
>
> Previously, the caller needed to allocate the memory and the
> TupleHashTable would store a pointer to it. That wastes space for the
> palloc overhead as well as the size of the pointer itself.
>
> Now, the TupleHashTable relies on the caller to correctly specify the
> additionalsize, and allocates that amount of space. The caller can
> then request a pointer into that space.
>
> Discussion: https://postgr.es/m/b9cbf0219a9859dc8d240311643ff4362fd9602c.camel@j-davis.com
> Reviewed-by: Heikki Linnakangas
>
> Branch
> ------
> master
>
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/e0ece2a981ee9068f50c4423e303836c2585eb02
>
> Modified Files
> --------------
> src/backend/executor/execGrouping.c | 57 +++++++++++++++++++++++++++++++++++--
> src/backend/executor/nodeAgg.c | 20 ++++++-------
> src/backend/executor/nodeSetOp.c | 17 +++++------
> src/backend/executor/nodeSubplan.c | 2 +-
> src/include/executor/executor.h | 3 ++
> src/include/nodes/execnodes.h | 10 ++-----
> 6 files changed, 78 insertions(+), 31 deletions(-)
>

Seems this introduced an indent issue? It should be a whitespace
rather than a tab after the semicolon.

@@ -835,6 +828,7 @@ typedef struct TupleHashTableData
Oid *tab_collations; /* collations for hash and comparison */
MemoryContext tablecxt; /* memory context containing table */
MemoryContext tempcxt; /* context for function evaluations */
+ Size additionalsize; /* size of additional data */

--
Regards
Junwang Zhao

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2025-01-11 10:54:33 pgsql: Add support for NOT ENFORCED in CHECK constraints
Previous Message Alvaro Herrera 2025-01-11 09:02:50 Re: pgsql: Consolidate docs for vacuum-related GUCs in new subsection