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 1pEpBS-0002DQ-AG for pgsql-general@arkaria.postgresql.org; Mon, 09 Jan 2023 10:15:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pEpBR-00022g-83 for pgsql-general@arkaria.postgresql.org; Mon, 09 Jan 2023 10:15:13 +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 1pEpBQ-00022W-Rj for pgsql-general@lists.postgresql.org; Mon, 09 Jan 2023 10:15:12 +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 1pEpBN-0002JZ-QI for pgsql-general@lists.postgresql.org; Mon, 09 Jan 2023 10:15:11 +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=NYn3eJZpsI/IOSOSAzuPtvwAbbCbssyGornJrfJ2YEU=; b=QMPJV/+bDmIwOhD5WBXtZ4aAMV ysVj5QwqK5nWFLrOy3i3W14MTIaXLUSp1KjKVuvsNoJqQ61+1flwNgHrf96C01g0XH5MG9HquDkIx ktdkvC+1apcCv0XQJRZfIdqX9s5MOt/FBEqyjgmpToHdD6PPRpjIh0Ygr0C7s+6I3qqg=; Received: from depesz by depesz.com with local (Exim 4.94.2) (envelope-from ) id 1pEpBK-004N1k-Hc; Mon, 09 Jan 2023 11:15:06 +0100 Date: Mon, 9 Jan 2023 11:15:06 +0100 From: hubert depesz lubaczewski Sender: depesz@depesz.com To: Julien Rouhaud Cc: Rushikesh socha , pgsql-general@lists.postgresql.org Subject: Re: Exact same output - pg_stat_statements Message-ID: Reply-To: depesz@depesz.com References: <20230103055217.lyxlchy26jtvhnwj@jrouhaud> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230103055217.lyxlchy26jtvhnwj@jrouhaud> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jan 03, 2023 at 01:52:17PM +0800, Julien Rouhaud wrote: > Resetting the data adds some noticeable overhead as newly added entries will > need to generate a normalize query string and so on. What most people do is > taking regular snapshots of pg_stat_statements (and other stats) view and then > compare the snapshots. There are a few open source projects doing that > available. Why do you assume that the cost of normalization query string will be in any way measurable? Especially in comparison do extra cost of doin math on potentially thousands of rows? Best regards, depesz