Re: Sample rate added to pg_stat_statements - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: Sample rate added to pg_stat_statements
Date
Msg-id CAA5RZ0trJoVqGmELHOc=G2SxHQHKdTb1aAvzf3vHdfVP8UH+Xg@mail.gmail.com
Whole thread Raw
In response to Re: Sample rate added to pg_stat_statements  (Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>)
Responses Re: Sample rate added to pg_stat_statements
List pgsql-hackers
> 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



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: ReplicationSlotRelease() crashes when the instance is in the single user mode
Next
From: Andres Freund
Date:
Subject: Re: Bump soft open file limit (RLIMIT_NOFILE) to hard limit on startup