Re: Performance issue on temporary relations - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Performance issue on temporary relations
Date
Msg-id CAKFQuwYd-2bTd_nENYMTfmKbpX8BCAKBBf9UGsvEzujZM7CGxg@mail.gmail.com
Whole thread Raw
In response to Re: Performance issue on temporary relations  ("章晨曦" <zhangchenxi@halodbtech.com>)
Responses Re: Performance issue on temporary relations
List pgsql-hackers
On Tue, Aug 19, 2025 at 8:45 AM 章晨曦 <zhangchenxi@halodbtech.com> wrote:
> I do not think this is something we ought to consider.  It might help
> certain corner use-cases, but it's probably a net loss for most.
> In particular, I don't think that creating thousands of temp tables in
> a session but then touching only a few of them in any one transaction
> is a very plausible usage pattern.

Acturely, we just facing such problem in some real systems. More than 3,700
temporary tables created! I accept such case is not that common, but it does exist.


It is unfair to add a performance penalty to everyone just because some people write bad code.  I concur that adding complexity to the system to gracefully handle this corner-case doesn't seem justified.  A use case description, not mere existence, is needed to provide such justification.

David J.

pgsql-hackers by date:

Previous
From: Filip Janus
Date:
Subject: Re: Proposal: Adding compression of temporary files
Next
From: Tom Lane
Date:
Subject: Re: When deleting the plpgsql function, release the CachedPlan of the function