ankane/dexter

Assumptions about pg_stat_statements not mentioned in docs

jfinzel opened this issue · 2 comments

pg_stat_statements is not on by default in Postgres. In fact, the library has to be loaded with the server and is an extension that has to be installed.

It also can be cleared out very easily on a busy system, and thus is in no way guaranteed to contain the query in your logfile. So there are 2 issues here:

  • It is not mentioned in the docs that the pg_stat_statements extension is required
  • If it is required, you will have difficulty relying on it because based on its configuration, it may not contain your query.

Why is pg_stat_statements required if you already have the SQL statement in the logs? You should be able to use this alone to plan the query and compare.

Hey @jfinzel, pg_stat_statements is an alternative to logs as the source of queries. Is there something that makes you think it's required?

I misread your code. I'm not super great at ruby :).

Can you at least add something brief on the docs related to it, if it's supported? I searched there and didn't find any mention of it. Thanks. You can close this.