powa-team / powa-archivist

powa-archivist: the powa PostgreSQL extension
http://powa.readthedocs.io/
PostgreSQL License
56 stars 20 forks source link

Extension pg_profile influences extension powa #48

Closed simonuwe closed 11 months ago

simonuwe commented 2 years ago

When the extension pg_profile is installed it causes powa to report wrong values. The reason is that pg_profile resets after taking a snapshots the postgres internal statistics. It calls several functions to reset statistics for example it calls pg_stat_statements_reset() to reset the counters in pg_stat_statements. This causes unexpected data in the powa_statements_history... tables. Now the values are not continuously increasing anymore.

Suggestion: Add this "side effect" of pg_profile as a known issue to the powa docu.

rjuju commented 2 years ago

Hi,

ah I didn't know that this extension was resetting the statistics. We can try to document that, but arguably it should be pg_profile duty to clearly document that using the extension kind of means that you can't use pg_stat_statements anymore for any other purpose, as powa is probably not the only project impacted.

simonuwe commented 2 years ago

It's documented in pg_profile that they call pg_stat_statements_reset(), but that this could cause other tools to report wrong data is not mentioned. I opened an issue there to add this to the docu.

rjuju commented 11 months ago

For the record I added a note in the documentation to mention that powa won't work well if you reset the metrics regularly. I also see that pg_profile also mention it in their docs so it loos like I can close this issue.