On 20.02.2025 04:04, Sami Imseih wrote:
In my opinion, sample rate is a better fit for pg_stat_statements,
since the queries that
you care about the most are usually the most frequently executed. Sampling them
will still provide enough good data without the risk of not capturing
statistics about
them at all.
Longer running queries will also likely be the least frequent, so they
are already not likely
contributing to the spinlock contention. Also, the least frequent
queries will likely be aged
out faster, so pg_stat_statements was never really a good candidate to
track those anyways;
slow query logging with log_min_duration_statement is a better way to
ensure you capture
the data.
Maybe others may have a different opinion?
--
Sami
Hi everyone,
Since most people have expressed support for sampling based on frequency of query, I will revert the rebased patch for version v15. Also, given that everyone is likely busy with the higher-priority task of IN normalization in pg_stat_statements, I will leave the rebased v19-patch here and move it back to Ready for Committer, as the patch has already been it.
Any suggestions are welcome.
--
Best regards,
Ilia Evdokimov,
Tantor Labs LLC.