Doc update for pg_stat_statements normalization - Mailing list pgsql-hackers

From Imseih (AWS), Sami
Subject Doc update for pg_stat_statements normalization
Date
Msg-id 9CFF3512-355B-4676-8CCC-6CF622F4DC1A@amazon.com
Whole thread Raw
Responses Re: Doc update for pg_stat_statements normalization
Re: Doc update for pg_stat_statements normalization
List pgsql-hackers

Replacing constants in pg_stat_statements is on a best effort basis.

It is not unlikely that on a busy workload with heavy entry deallocation,

the user may observe the query with the constants in pg_stat_statements.

 

From what I can see, this is because the only time an entry is normalized is

during post_parse_analyze, and the entry may be deallocated by the time query

execution ends. At that point, the original form ( with constants ) of the query

is used.

 

It is not clear how prevalent this is in real-world workloads, but it's easily reproducible

on a workload with high entry deallocation. Attached are the repro steps on the latest

branch.

 

I think the only thing to do here is to call this out in docs with a suggestion to increase

pg_stat_statements.max to reduce the likelihood. I also attached the suggested

doc enhancement as well.

 

Any thoughts?

 

Regards,

 

--

Sami Imseih

Amazon Web Services

 

 

Attachment

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Marking options deprecated in help output
Next
From: Corey Huinker
Date:
Subject: Re: Disable vacuuming to provide data history