Re: Sample rate added to pg_stat_statements

From: Ilia Evdokimov <ilya(dot)evdokimov(at)tantorlabs(dot)com>
To: Sami Imseih <samimseih(at)gmail(dot)com>
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Greg Sabino Mullane <htamfids(at)gmail(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Alena Rybakina <a(dot)rybakina(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Sample rate added to pg_stat_statements
Date: 2025-02-26 10:51:13
Message-ID: 4124423f-b9bb-40e8-ab4d-a08010ab83ab@tantorlabs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 20.02.2025 03:32, Sami Imseih wrote:
>> As you can see, the query has not been normalized. Is it a bug, expected or undefined behavior?
> No, this behavior is expected. The ability to normalize a statement is
> only available
> during post_parse_analyze (pgss_post_parse_analyze), as this is when
> we have access to
> JumbleState.
>
> In your example, pgss_post_parse_analyze is skipped and during the
> subsequent \bind_named,
> ExecutorEnd (pgss_ExecutorEnd) does not have access to JumbleState,
> leading to the query to be stored without normalization.
>
> It will be nice to make JumbleState available to all hooks, IMO.
>
> --
> Sami

Got it. I think it's worth considering, but not within the scope of this
thread.

--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2025-02-26 10:54:08 Re: Anti join confusion
Previous Message Tender Wang 2025-02-26 10:08:56 Re: Anti join confusion