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 1lglnl-0007B3-Bn for pgsql-hackers@arkaria.postgresql.org; Wed, 12 May 2021 10:09:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lglnj-0001K2-H7 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 May 2021 10:09:11 +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 1lglnj-0001Js-9B for pgsql-hackers@lists.postgresql.org; Wed, 12 May 2021 10:09:11 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lglnd-0003ur-RL for pgsql-hackers@lists.postgresql.org; Wed, 12 May 2021 10:09:10 +0000 Received: by mail-pj1-x102a.google.com with SMTP id lj11-20020a17090b344bb029015bc3073608so3025116pjb.3 for ; Wed, 12 May 2021 03:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mHTMksNxRApWkrC/U9/JGrhK7MrH78hhW6fj7pVgfgQ=; b=ASzShDtWrw80a/CRWitr+Hry+tBf8HZj5S50tXJf0SlAxPApRNmWwpQ7AT32OgYfVq Hoy0jILu+QNtCSSYP3DMdhtJlK0/CDriD036CgXQz2qVNb/tdgtsk4ytpDOsl5piByRN UsTam1ZK1YyNRkgnf+FC/rucWJvoefezflFtkJSsc6ONOVEBnLHz5yxiHuxJJgq0R9jA ODn3IcG3PK9CyCJCmRkBqLVEvgw7wHGu4efnfFGja4VoFc/iNXGidGOfTy93F7D/1b4C kF20DGLRv3D0lB2cRLBk6S4iJZcQH4oqm47uOqRXB18vxXbmu4zJ0tUxFGLHSOkggIHo POmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mHTMksNxRApWkrC/U9/JGrhK7MrH78hhW6fj7pVgfgQ=; b=gIoFRzcE3YKizkYgVp7i2iYCNSVlIbFP94o3E0T68jGj2dNu1PV+jpdhQt4UMuW7lE K8+n+VMf9MlwxWWLdf/TKZR05yENp5VoWVCZIruqnNOt9biwNtYeweynp0CGMpJiTT5C J1XGKcCmgakxhCOCgjXcXByyU2xnZpVxZ+BJzAGkiZP4qNQJHQmGB8cWlqse2N/RBGTQ P79azWRieSdBfR5tWjsOxfBIxq7bS3RhLqsLFBIG+kCuFOSR79EKk9RXLc4KGM0QzPOz uOimKiU7QsEi9WosSZW5geBX3y19nwAyiAO0pSwPs99AzCl3D5vhSTbLr0TY6e6vjJcO TDnw== X-Gm-Message-State: AOAM532SWaTYtKRms5EAt/1H/zHZgOuSZ0FNUDgDK+/BjS8Ls4zlLQt2 d6tlhp1wbGKbdsFOhH74yuc= X-Google-Smtp-Source: ABdhPJzpBn+FUy9G4WEvQ8dAGjVnoSOQub+63Od36ZYWEmUfxDVz0gqhSOKLg+XBVMQdFIfCaIxOLA== X-Received: by 2002:a17:90b:f94:: with SMTP id ft20mr801743pjb.161.1620814144837; Wed, 12 May 2021 03:09:04 -0700 (PDT) Received: from nol (2001-b011-0008-929a-d1b5-2d99-2ba7-4d91.dynamic-ip6.hinet.net. [2001:b011:8:929a:d1b5:2d99:2ba7:4d91]) by smtp.gmail.com with ESMTPSA id p11sm11615891pgn.65.2021.05.12.03.09.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 03:09:04 -0700 (PDT) Date: Wed, 12 May 2021 18:09:30 +0800 From: Julien Rouhaud To: Kyotaro Horiguchi Cc: magnus@hagander.net, masao.fujii@oss.nttdata.com, michael@paquier.xyz, andres@anarazel.de, tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, sfrost@snowman.net, bruce@momjian.us, myon@debian.org, peter.eisentraut@enterprisedb.com, pgsql-hackers@lists.postgresql.org Subject: Re: compute_query_id and pg_stat_statements Message-ID: <20210512100930.ex5cwkhng2gupgyn@nol> References: <20210512024201.ak3ofofakn2ymhiv@nol> <20210512.143335.1053382893089496881.horikyota.ntt@gmail.com> <20210512060516.g2ebxgvbiglkgfv7@nol> <20210512.183724.859740020819002744.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210512.183724.859740020819002744.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, May 12, 2021 at 06:37:24PM +0900, Kyotaro Horiguchi wrote: > At Wed, 12 May 2021 14:05:16 +0800, Julien Rouhaud wrote in > > > > And if I'm not mistaken, pg_store_plans also wants a different queryid > > implementation, but has to handle a secondary queryid on top of it > > (https://github.com/ossc-db/pg_store_plans/blob/master/pg_store_plans.c#L843-L855). > > Yeah, the extension intended to be used joining with the > pg_stat_statements view. And the reason for the second query-id dates > back to the era when query id was not available in the > pg_stat_statements view. Now it is mere a fall-back query id when > pg_stat_statments is not active. Now that the in-core query-id is > available, I think there's no reason to keep that implement. > > > So here again what the extension want is to get rid of pg_stat_statements (and > > now core) queryid implementation. > > So the extension might be a good reason for the discussion^^; Indeed. So IIUC, what pg_store_plans wants is: - to use its own query_id implementation - to be able to be joined to pg_stat_statements Is that correct? If yes, it seems that starting with pg14, it can be easily achieved by: - documenting to disable compute_query_id - eventually error out at execution time if it's enabled - don't call queryIdWanted() - expose its query_id It will then work just fine, and will be more efficient compared to what is done today as only one queryid will be calculated. Did I miss something?