Re: Use BumpContext contexts for TupleHashTables' tablecxt - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Use BumpContext contexts for TupleHashTables' tablecxt
Date
Msg-id 2277093.1761516686@sss.pgh.pa.us
Whole thread Raw
In response to Re: Use BumpContext contexts for TupleHashTables' tablecxt  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Use BumpContext contexts for TupleHashTables' tablecxt
List pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> I can't help wonder if we can improve the memory context parameter
> names in BuildTupleHashTable(). Every time I see "tablecxt" I have to
> remind myself that it's not for the bucket array, just the stuff we
> have the buckets point to. Would "hashedtuplecxt" be better?

I agree these names are not great.  I think they might be leftovers
from a time when there actually was a complete hash-table structure
in that context.

Related to this, while I was chasing Jeff's complaint I realized that
the none-too-small simplehash table for this is getting made in the
query's ExecutorState.  That's pretty awful from the standpoint of
being able to blame memory consumption on the hash node.  I'm not
sure though if we want to go so far as to make another context just
for the simplehash table.  We could keep it in that same "tablectx"
at the price of destroying and rebuilding the simplehash table, not
just resetting it, at each node rescan.  But that's not ideal either.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: PG18 GIN parallel index build crash - invalid memory alloc request size
Next
From: David Rowley
Date:
Subject: Re: Should HashSetOp go away