Re: Exact same output - pg_stat_statements - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Exact same output - pg_stat_statements
Date
Msg-id Y7LdVeKa2kq0gOPq@depesz.com
Whole thread Raw
In response to Exact same output - pg_stat_statements  (Rushikesh socha <rushikesh.s@gmail.com>)
Responses Re: Exact same output - pg_stat_statements  (Julien Rouhaud <rjuju123@gmail.com>)
List pgsql-general
On Fri, Dec 30, 2022 at 11:04:59AM -0500, Rushikesh socha wrote:
> Hi, Whenever I am running the below query on one of my Azure PostgreSQL
> PaaS instances I am getting exact same output. I feel it shows old
> information but as far as i know pg_stat_statements only shows current
> information and not past right ? It may be a bug?

pg_stat_statements has all the data since last reset of stats.

So if you never reset stats, it accumulated data for howeve rlong you
are using pg.

Not really surprising that top total-time uses are the same.

If you want to sensibly use it you should call reset function every now
and then.
Best regards,

depesz




pgsql-general by date:

Previous
From: Matthias Apitz
Date:
Subject: Re: PostgreSQL 12 service failing in Ubuntu 20.04 after a few hours
Next
From: "jacktby@gmail.com"
Date:
Subject: what kind of hash algorithm is used by hash_bytes()?