Re: log_statement vs Statistics Collector (pg_stat_database,, etc) - Mailing list pgsql-admin

From Matheus de Oliveira
Subject Re: log_statement vs Statistics Collector (pg_stat_database,, etc)
Date
Msg-id CAJghg4J6+d7VU4tcSK8o_LEcEFkh3LH6zSOY6Az_ghbojEOdGw@mail.gmail.com
Whole thread Raw
In response to log_statement vs Statistics Collector (pg_stat_database,, etc)  (Nik Tek <niktek2005@gmail.com>)
Responses Re: log_statement vs Statistics Collector (pg_stat_database,, etc)
List pgsql-admin

On Thu, Dec 24, 2015 at 7:32 PM, Nik Tek <niktek2005@gmail.com> wrote:
I wanted to capture all the DML statements executed in the database information (execution time, ).

Question:
Can anyone point me pros and cons on either of the approaches.

In my testing, I haven't found any performance degrade on application operations when enabled the additional logging (below logging).

Besides log_min_duration_statement, you can use tools like pg_stat_statements [1] and POWA [2]. POWA authors even did a comparison of performance impact of having log_min_duration_statement (to latter process with pgBadger), using POWA extension and nothing, see [3].

[1] http://www.postgresql.org/docs/current/static/pgstatstatements.html
[2] http://dalibo.github.io/powa/
[3] https://github.com/dalibo/powa/wiki/POWA-vs-pgBadger


--
Matheus de Oliveira


pgsql-admin by date:

Previous
From: Nik Tek
Date:
Subject: log_statement vs Statistics Collector (pg_stat_database,, etc)
Next
From: "Scott Neville"
Date:
Subject: Re: Slow planning time