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 1kPfdI-0003Vw-GL for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Oct 2020 05:35:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kPfdH-0008Lg-E8 for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Oct 2020 05:35:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPfdH-0008LX-7t for pgsql-hackers@lists.postgresql.org; Tue, 06 Oct 2020 05:35:27 +0000 Received: from [64.147.123.17] (helo=wnew3-smtp.messagingengine.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kPfdD-0004BZ-Hh for pgsql-hackers@lists.postgresql.org; Tue, 06 Oct 2020 05:35:26 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.west.internal (Postfix) with ESMTP id 2D87D316; Tue, 6 Oct 2020 01:35:10 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 06 Oct 2020 01:35:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=Z1e/hi2GzeR2YQ6WXPKhOS4egJ9 +0dnzdomz1vnnmeM=; b=t+ec0usFmlFjYkqSLgNAnEKpLhpW1Fwim3fuOGd1eXc exKXwEDGbkQa5Z86+FEU/QZmU32C6ZSEox+vSeBFOa2NXF1HX8DWAuh4iJ/LkSjp 1cVCtVfC/VWMmzbvDL1eGIc6WgQlf+iKxOKaQKeqx7PW/Ck/SUuZGK5hik5/bkbq ebFIau6Td8g1ypnrSLYbF6NyYH6WcXIxfVpSMlVc/O9qJHe5ieVmIH/TdHN0poOC 4/elQvR8mW5yN34tOFgVWrcv3srU/2Lsy0SINmMuYT49PlFZbhAjDlyO4Sgo/mlO 9rvlG+Jp2CcOtUiuahx0vnG2Ns30HGJhyw7uQ8k8ciA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Z1e/hi 2GzeR2YQ6WXPKhOS4egJ9+0dnzdomz1vnnmeM=; b=i71zXgD/oRGQWvpFSHgRzK eBIKQW1K4gO+1cIYKdzKxgWgj2qkyckMPGaLoq0RB44xp6kTQ4zeQ3c6xYoBNmJw VdLFeV57b22VXPNlM5NHemZwcgdBeXlOfgQQP4+Xpy2WPJvqenDAz/EGlh45a/LJ DZBNBWxX5ZL0LYfeHoak16Yw0a6NhpoeMvI4fefHtr/ivKaVXIZvEyaLb4l/AO3J NKtMNdnQNcHwouAIlpXUf1DjdfpW6XeHw/3FTjhj3M8gE3Zd3UdNDYiz0MGMoEL3 2aa3lwZYVt2TiCIqr/Jq53aCzGxqyq0AQ6wOZbj5dSDMc9MlHA9bhomZ/4wcALzQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrgeefgdeljecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveejheeh ieevueeigeelteegleejleeiueeiheegvefhnecukfhppeduudekrddvgedurddvhedurd dvtddtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep mhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (mp76f1fbc8.ap.nuro.jp [118.241.251.200]) by mail.messagingengine.com (Postfix) with ESMTPA id E7AAA3064674; Tue, 6 Oct 2020 01:35:05 -0400 (EDT) Date: Tue, 6 Oct 2020 14:34:58 +0900 From: Michael Paquier To: Bruce Momjian Cc: Julien Rouhaud , Alvaro Herrera , Tom Lane , torikoshia , Atsushi Torikoshi , Tatsuro Yamada , Robert Haas , Tomas Vondra , Evgeny Efimkin , PostgreSQL Hackers Subject: Re: Feature improvement: can we add queryId for pg_catalog.pg_stat_activity view? Message-ID: <20201006053458.GA429@paquier.xyz> References: <1817289.1601934179@sss.pgh.pa.us> <20201005225842.GA8918@alvherre.pgsql> <20201006021819.GA10975@momjian.us> <20201006032350.GA3686@momjian.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline In-Reply-To: <20201006032350.GA3686@momjian.us> X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.17 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 05, 2020 at 11:23:50PM -0400, Bruce Momjian wrote: > On Tue, Oct 6, 2020 at 11:11:27AM +0800, Julien Rouhaud wrote: >> Maybe we could add a new hook for only queryid computation, and add a >> GUC to let people choose between no queryid computed, core computation >> (current pg_stat_statement) and 3rd party plugin? >=20 > That all seems very complicated. If we go in that direction, I suggest > we just give up getting any of this into core. A GUC would have at least the advantage to make the computation consistent for any system willing to consume it, with the option to not pay any potential performance impact, though I have to admit that just moving the query ID computation of PGSS into core may not be the best option as a query ID of 0 means the same thing for a utility, for an initialization, and for a backend running a query with an unknown value, but that could be worked out. FWIW, I think that adding the system ID in the hash is too restrictive, as it could be interesting for users to do stat comparisons across multiple systems running the same major version. It would be better to not give any strong guarantee that the query ID computed will remain consistent across major versions so as it is possible to keep improving it. Also, if nothing has been done that changes the hashing computation, I see little benefit in forcing a breakage by adding something like PG_MAJORVERSION_NUM or such in the hash computation. -- Michael --17pEHd4RhPHOinZp Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl98AgIACgkQnvQgOdby QH0ukQ//X9trpFO/1GoR+twGeAGEr9KB0vlfPqRcShBvWB3b/Xi72UZdERKznKoN ZxwpXouf0BY251HwqymlMQbIT8NbtZ++QwGVodr+qeg6o7Hvbm1ADW/NChjQFbEs xtvosSYjDcxGi3M30/M7b4UhgdC0LKy8UaPNsx2eoW07+DPdWXHMXpMnDWP+IX9M 5fU+qDbUIMC30hiqudauyTxMDwwQ759I4kNESs9BBcltDST68S91hyvGJ1uFmYHk /KkIjN9op/bHnsvlKuAKWGV3bsXqnQTVsVMCfPtbhETkCBAyrTgTiBntC31DvGnu gN4nzTslxw90YpceZDPi0e0nHc0W8lauw1QxMQO5lA6OhIfgwNrdyOtYaCvV8f5z AbiioSYqiLDrD5+iJC92Ew0GvhZH88bO0H4nbKYRwXIevWQt1LfhVwd/+wRUzVDS tga9hMEyWyLdKtbW/2BrS3anGDjAwB+hk+QX4BJA33isTPU6tv2OcIsgPZfl8c7A xfXbuw3k56QcEbrslQmMpVWQ+hM3IuUpIrGDTUDk/oSrYRqrIfS4LY2DOzPo7oyH JpO7VxMkzDysgAtqmfOyLgjGj58XrumMQVhqRYb/3iGlQnVLsdA5dG3NIEb0iISM efiBL3pfTZLhInGjr1TpFwIKQtX9pELgsUo8qAw9jcT/hi2NG5A= =ys1u -----END PGP SIGNATURE----- --17pEHd4RhPHOinZp--