Re: Remove useless memory context switch in ExecHashTableCreate()

From: cca5507 <cca5507(at)qq(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Remove useless memory context switch in ExecHashTableCreate()
Date: 2026-12-04 06:54:49
Message-ID: tencent_07C8C0E01D1DC4D81984821482D5FAA79C0A@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

> > Now PrepareTempTablespaces() will not be called within hashCxt, but I
> > think it's ok.
>
> I do, too, but only after inspecting the code to be sure
> PrepareTempTablespaces() doesn't ever leak memory.  While that's pretty old
> code that is unlikely to withstand too many changes in the future, IMHO
> it'd be a good idea to note that some callers depend on it not leaking
> memory.  That way, future patch authors will be more likely to free
> everything they allocated.

I think it's harmless even if it leaks some memory because we only need
to call it once within a transaction, so the memory won’t grow indefinitely.

--
Regards,
ChangAo Chen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tender Wang 2026-12-04 06:58:22 Hash join costing can overestimate inner MCV frequency with extended statistics
Previous Message Shlok Kyal 2026-12-04 06:38:34 Re: DROP SUBSCRIPTION deadlock with ALTER SUBSCRIPTION OWNER TO