Re: query_id: jumble names of temp tables for better pg_stat_statement UX

From: Lukas Fittl <lukas(at)fittl(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Sami Imseih <samimseih(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Christoph Berg <myon(at)debian(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, ma lz <ma100(at)hotmail(dot)com>
Subject: Re: query_id: jumble names of temp tables for better pg_stat_statement UX
Date: 2025-03-25 06:09:06
Message-ID: CAP53PkzAPrHNHquT76mVjfStrz0B2hKhF+CbAZ_w9QJUJ_1oJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Mon, Mar 24, 2025 at 8:51 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Mon, Mar 24, 2025 at 09:38:35PM -0500, Sami Imseih wrote:
> > > select * from foo s1;
> > > select * from foo s2;
> >
> > ah, thanks for pointing this out. Not as good of a workaround as
> > a comment since one must change aliases, but at least there is
> > a workaround...
>
> Exactly. Like Tom I'm not really worried about the proposal, but of
> course I could prove to be wrong. I am ready to assume that bloat in
> pgss entries caused by temp tables is a more common case.
>

For what its worth, +1 on the current proposal in this thread (and doing it
without a GUC), i.e. merging a query that references the same table alias,
ignoring different schemas.

In the context of the earlier referenced one-schema-per-customer workloads:

In my experience these often not work well with pg_stat_statements today
because of their own bloat problem, just like with temp tables. You quickly
have way too many unique entries, and your query text file accumulates a
lot of duplicative entries (since the same query text gets repeated in the
text file, since its queryid is different), to the point that you can't
monitor your workload at all anymore.

Thanks,
Lukas

--
Lukas Fittl

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2025-03-25 07:02:08 Re: query_id: jumble names of temp tables for better pg_stat_statement UX
Previous Message Álvaro Herrera 2025-03-25 05:59:30 Re: Today Page is not accessible - postgresql-15.spec

Browse pgsql-hackers by date

  From Date Subject
Next Message Alena Rybakina 2025-03-25 06:12:57 Re: Vacuum statistics
Previous Message vignesh C 2025-03-25 05:35:46 Re: Logical Replication of sequences