pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: TupleHashTable: store additional data along with tuple.
3+ messages / 3 participants
[nested] [flat]

* pgsql: TupleHashTable: store additional data along with tuple.
@ 2025-01-11 01:32 Jeff Davis <jdavis@postgresql.org>
  2025-01-11 10:18 ` Re: pgsql: TupleHashTable: store additional data along with tuple. Junwang Zhao <zhjwpku@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Jeff Davis @ 2025-01-11 01:32 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: TupleHashTable: store additional data along with tuple.
  2025-01-11 01:32 pgsql: TupleHashTable: store additional data along with tuple. Jeff Davis <jdavis@postgresql.org>
@ 2025-01-11 10:18 ` Junwang Zhao <zhjwpku@gmail.com>
  2025-01-11 13:14   ` Re: pgsql: TupleHashTable: store additional data along with tuple. Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 1 reply; 3+ messages in thread

From: Junwang Zhao @ 2025-01-11 10:18 UTC (permalink / raw)
  To: Jeff Davis <jdavis@postgresql.org>; +Cc: pgsql-committers@lists.postgresql.org

Hi Jeff,

On Sat, Jan 11, 2025 at 9:32 AM Jeff Davis <jdavis@postgresql.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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgsql: TupleHashTable: store additional data along with tuple.
  2025-01-11 01:32 pgsql: TupleHashTable: store additional data along with tuple. Jeff Davis <jdavis@postgresql.org>
  2025-01-11 10:18 ` Re: pgsql: TupleHashTable: store additional data along with tuple. Junwang Zhao <zhjwpku@gmail.com>
@ 2025-01-11 13:14   ` Alvaro Herrera <alvherre@alvh.no-ip.org>
  0 siblings, 0 replies; 3+ messages in thread

From: Alvaro Herrera @ 2025-01-11 13:14 UTC (permalink / raw)
  To: Junwang Zhao <zhjwpku@gmail.com>; +Cc: Jeff Davis <jdavis@postgresql.org>; pgsql-committers@lists.postgresql.org

On 2025-Jan-11, Junwang Zhao wrote:

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

Yeah, there's an issue in execGrouping.c as well.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
Subversion to GIT: the shortest path to happiness I've ever heard of
                                                (Alexey Klyukin)





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-01-11 13:14 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-01-11 01:32 pgsql: TupleHashTable: store additional data along with tuple. Jeff Davis <jdavis@postgresql.org>
2025-01-11 10:18 ` Junwang Zhao <zhjwpku@gmail.com>
2025-01-11 13:14   ` Alvaro Herrera <alvherre@alvh.no-ip.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox