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 1lb5r8-0002oI-Ch for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Apr 2021 18:21: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 1lb5r7-0002b6-06 for pgsql-hackers@arkaria.postgresql.org; Mon, 26 Apr 2021 18:21:13 +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 1lb5r6-0002az-Pn for pgsql-hackers@lists.postgresql.org; Mon, 26 Apr 2021 18:21:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lb5r4-00005o-16 for pgsql-hackers@lists.postgresql.org; Mon, 26 Apr 2021 18:21:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 13QIL0k12295573; Mon, 26 Apr 2021 14:21:00 -0400 From: Tom Lane To: Andres Freund cc: Alvaro Herrera , Stephen Frost , Magnus Hagander , Bruce Momjian , Christoph Berg , Peter Eisentraut , Fujii Masao , PostgreSQL Developers Subject: Re: compute_query_id and pg_stat_statements In-reply-to: <20210426181408.3j6kkzpxnadpwptv@alap3.anarazel.de> References: <2268611.1619458140@sss.pgh.pa.us> <20210426174331.GA19401@alvherre.pgsql> <20210426181408.3j6kkzpxnadpwptv@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 26 Apr 2021 11:14:08 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2295571.1619461260.1@sss.pgh.pa.us> Date: Mon, 26 Apr 2021 14:21:00 -0400 Message-ID: <2295572.1619461260@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > I think that's the right direction. I wonder though if we shouldn't go a > bit further. Have one guc that determines the "query id provider" (NULL > or a shared library), and one GUC that configures whether query-id is > computed (never, on-demand/auto, always). For the provider GUC load the > .so and look up a function with some well known name. That's sounding like a pretty sane design, actually. Not sure about the shared-library-name-with-fixed-function-name detail, but certainly it seems to be useful to separate "I need a query-id" from the details of the ID calculation. Rather than a GUC per se for the ID provider, maybe we could have a function hook that defaults to pointing at the in-core computation, and then a module wanting to override that just gets into the hook. regards, tom lane