Re: Log a sample of transactions

Adrien Nayrat <adrien.nayrat@anayrat.info>

From: Adrien NAYRAT <adrien.nayrat@anayrat.info>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>, "PostgreSQL mailing lists" <pgsql-hackers@postgresql.org>, Nikolay Samokhvalov <samokhvalov@gmail.com>
Date: 2019-01-15T17:03:36Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Tweak docs for log_statement_sample_rate

On 1/15/19 11:42 AM, Masahiko Sawada wrote:
>> When you troubleshoot applicative issues with multi-statements transaction, you may have to log all queries to find all statements of one transaction. With high throughput, it could be hard to log all queries without causing troubles.
> Hm, can we use log_min_duration_statement to find slow queries of a
> transaction instead? Could you please elaborate on the use-case?

Hello,

The goal is not to find slow queries in a transaction, but troubleshoot 
applicative issue when you have short queries.

Sometimes you want to understand what happens in a transaction, either 
you perfectly know your application, either you have to log all queries 
and find ones with the same transaction ID (%x). It could be problematic 
if you have a huge traffic with fast queries.


Thanks,