Log a sample of transactions

Поиск
Список
Период
Сортировка
От Adrien Nayrat
Тема Log a sample of transactions
Дата
Msg-id f5462aff-7bb4-f5b4-da3e-abb391956179@anayrat.info
обсуждение исходный текст
Ответы Re: Log a sample of transactions  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
RE: Log a sample of transactions  ("Kuroda, Hayato" <kuroda.hayato@jp.fujitsu.com>)
Список pgsql-hackers
Hello,

Per idea of Nikolay Samokhvalov[1] I propose this patch to add the possibility
to log all statements from a fraction of transactions.

I have several questions:
  * Do we want this feature?
  * How can I add tests? I seems hard to handle tests when a there is duration
in the output.
  * Should I handle the case when someone try to change the setting *inside* a
transaction:

# SET client_min_messages to LOG;
SET
# SET log_transaction_sample_rate to 1;
SET
# BEGIN;
LOG:  duration: 0.364 ms  statement: BEGIN;
BEGIN
# SELECT 1;
LOG:  duration: 0.530 ms  statement: SELECT 1;
-[ RECORD 1 ]
?column? | 1

# SET log_transaction_sample_rate to 0;
LOG:  duration: 0.333 ms  statement: SET log_transaction_sample_rate to 0;
SET
# SELECT 1;
LOG:  duration: 0.586 ms  statement: SELECT 1;
-[ RECORD 1 ]
?column? | 1

Thanks

[1]:
https://www.postgresql.org/message-id/CANNMO%2BLg65EFqHb%2BZYbMLKyE2y498HJzsdFrMnW1dQ6AFJ3Mpw%40mail.gmail.com


--
Adrien NAYRAT

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pablo Iranzo Gómez
Дата:
Сообщение: Re: Introducing SNI in TLS handshake for SSL connections
Следующее
От: John Naylor
Дата:
Сообщение: Re: WIP: Avoid creation of the free space map for small tables