2014-01-23 51 views

回答

1

postgresql.conflog_statement = all,調整log_line_prefix如果你想了解客戶端的更多細節。

您可能還需要CSV日誌記錄,以便您輕鬆分析它 - 包括將其加載到與COPY表中。見the documentation for CSV logging

有關日誌配置的更多詳細信息,包括日誌記錄長時間運行語句等,請參閱the documentation on log configuration

您不必全局設置這些選項;您可以使用ALTER USER my_play_user SET ...ALTER DATABASE my_play_database SET ...使其中的大部分對特定用戶或數據庫是本地的。

玩!框架還具有可以記錄發送給PostgreSQL的SQL的功能,這也可能非常方便。

要獲得更細粒度的分析/跟蹤,請查看auto_explain模塊,pg_stat_statementspg_stat_plans