Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pCKxJ-0001G8-7R for pgsql-general@arkaria.postgresql.org; Mon, 02 Jan 2023 13:34:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pCKxI-00015g-1b for pgsql-general@arkaria.postgresql.org; Mon, 02 Jan 2023 13:34:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pCKxH-00014r-K0 for pgsql-general@lists.postgresql.org; Mon, 02 Jan 2023 13:34:19 +0000 Received: from lana.depesz.com ([88.198.49.178] helo=depesz.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pCKxE-000898-Qy for pgsql-general@lists.postgresql.org; Mon, 02 Jan 2023 13:34:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=depesz.com; s=20170201; h=In-Reply-To:Content-Type:MIME-Version:References:Reply-To: Message-ID:Subject:Cc:To:Sender:From:Date:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jzJnyy445pZB7KWe4sWvfSl4qEJCQ7I5qdPUNVSguB0=; b=i6CY4EWFA5o1AEorJxtb+zHaAd c7agLLpQ6Ih67AFvZjhbktCrciPvvG3G67YeCg0qxyXIZxoCd1b43mYgYDVzmNuhBRVv/sp+qjqh/ ybr5iLzRSi9eOtEt9SzOsn+JPxP8yCkyXnSGHMu5erfbH5axTOQxoMduBhPx4Xr2shUQ=; Received: from depesz by depesz.com with local (Exim 4.94.2) (envelope-from ) id 1pCKxB-009F5W-4I; Mon, 02 Jan 2023 14:34:13 +0100 Date: Mon, 2 Jan 2023 14:34:13 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Rushikesh socha Cc: pgsql-general@lists.postgresql.org Subject: Re: Exact same output - pg_stat_statements Message-ID: Reply-To: depesz@depesz.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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