Re: query logging of prepared statements

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: query logging of prepared statements
Дата
Msg-id 20190404190126.GA6155@alvherre.pgsql
обсуждение исходный текст
Ответ на Re: query logging of prepared statements  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: query logging of prepared statements  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On 2019-Apr-04, Alvaro Herrera wrote:

> I think we could improve on this by setting a "logged" flag in the
> portal; if the Parse logs the statement, then don't include the
> statement in further lines, otherwise do.

Also: I think such a flag could help the case of a query that takes
long enough to execute to exceed the log_min_duration_statement, but not
long enough to parse.  Right now, log_min_duration_statement=500 shows

2019-04-04 15:59:39 -03 [6353-1] LOG:  duration: 2002.298 ms  execute <unnamed>
2019-04-04 15:59:39 -03 [6353-2] DETAIL:  parameters: $1 = 'joe''s place'

if I change the testlibpq3 query to be 
    "SELECT * FROM test1 WHERE t = $1 and pg_sleep(1) is not null",

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.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



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

Предыдущее
От: Shawn Debnath
Дата:
Сообщение: Re: Retronym: s/magnetic disk/main data/
Следующее
От: Andres Freund
Дата:
Сообщение: Re: COPY FROM WHEN condition