Re: Speedup truncations of temporary relation forks

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Daniil Davydov <3danissimo@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-06-01T02:22:25Z
Lists: pgsql-hackers
On Sat, May 31, 2025 at 01:26:14PM +0700, Daniil Davydov wrote:
> Not yet. I proceed from the assumption that if the temp_buffers
> parameter is set to a large value (some users set it to more than a
> gigabyte), then the vast majority of time is spent iterating through
> the local buffers.
> Thus, if we reduce the number of iterations from N to (for example)
> N/10, we can get a 10x increase in performance. Of course, this is a
> super rough assumption, but I think you understand my point.
> In the near future I will prepare a patch for the idea above and try
> to do some measurements. If there is a significant difference, I will
> definitely let you know.
> 
> Anyway, first I suggest committing the current patch.

I doubt that it would be a good idea to apply a patch "just" because
it looks like a good idea.  It is important to prove that something is
a good idea first.
--
Michael

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Speed up truncation of temporary relations.

  2. Speedup truncations of relation forks.