Re: query logging of prepared statements

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: query logging of prepared statements
Дата
Msg-id 20190406011638.pgb7uxjz2hnhavsu@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: query logging of prepared statements  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: query logging of prepared statements  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
Hi,

On 2019-04-04 16:01:26 -0300, Alvaro Herrera wrote:
> Also, if you parse once and bind/execute many times, IMO the statement
> should be logged exactly once.  I think you could that with the flag I
> propose.

I'm not actually sure I buy this.  Consider e.g. log analysis for
workloads with long-running connections. If most statements are just
already prepared statements - pretty common in higher throughput apps -
the query will suddenly be either far away in the logfile (thereby
requiring pretty expensive analysis to figure out the corresponding
statement) or even in a different logfile due to rotation.

I'm sympathetic to the desire to reduce log volume, but I'm fearful this
would make log analysis much harder.  Searching through many gigabytes
just to find the query text of the statement being executed over and
over doesn't sound great.

I think deduplicating the logging between bind and execute has less of
that hazard.

- Andres



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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Ordered Partitioned Table Scans
Следующее
От: Andres Freund
Дата:
Сообщение: Re: New vacuum option to do only freezing