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 1n6s5v-00035F-TD for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 10:40:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n6s5u-0002p3-Er for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Jan 2022 10:40:06 +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 1n6s5u-0002ot-3d for pgsql-hackers@lists.postgresql.org; Mon, 10 Jan 2022 10:40:06 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n6s5r-0003L8-OW for pgsql-hackers@lists.postgresql.org; Mon, 10 Jan 2022 10:40:04 +0000 Received: by mail-pj1-x1029.google.com with SMTP id n30-20020a17090a5aa100b001b2b6509685so15311506pji.3 for ; Mon, 10 Jan 2022 02:40:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7k+NTeWob0oqbieOef2VfJpxU//2t3ykktSwDIhZvM4=; b=LCqptnGNWM8eQG2rBJAvgLVszmYHUhBMbw17L6e5IOzcZVi1UD0SOxbc2iai4YJjHh tFb5vDQ7+kwcCl25UyqnviZHD7uda7kFSMS/fvG8ur7IljE+3AJKggClw5IbYlSE6QSu OKAJRg21klo19aZRH5acC2NTzMdAm8XOpf8QByhNr0ryad83qrSo/ev43MzlffTDR83E RBHrjPKnIKZ+yKp6eSyGoGJRVqHpA32VZD/JPTiZIsWXlGaZMkpUFTcEeC0OuzVkeuZd pokDuSF5ddtLiyrCuRaQVjj+EXcadncEL201rTh23yJfCn6gDbUurBLjrd+AUyHlgA8Q QeGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7k+NTeWob0oqbieOef2VfJpxU//2t3ykktSwDIhZvM4=; b=UNYS6opBReEQ1zRw8wsX6oE3WCJAnR25g0+QRxkrteyTDO1EOnc1MUEwcwlnOM+lOZ iZhRa0YcUhneyOTAfxt3Lk6tnzxchWVZNknF/cW6klSu84yE5qetTKxHCcK6iOKA4ihc xynPdQIoCuCjEvhg9PJQsTPC/LWyVjoJ5/QzaCm0HVnhuX8CkVepBsGAzxsHl6x4A2Tu jmonI6U0tcTcetkmuTDGNp8uJI5Q+LHBiZUHu8vOhQDzIvetFk8RrhCuXWnDNqydnMW/ ILVUdI7JTOJbjCqpUj4/vn7Eg+6SPTtSCgqz8yJci4vFG+zzaLJhxe0ndpfyFGaCNk57 +jkw== X-Gm-Message-State: AOAM532hUSCnUMKfke3I5KASQA+sBmxpBuAxV0HMjvHW90+El6LiJ6DG u5lLK4Zs6Y8mxWsbZKQv+0w= X-Google-Smtp-Source: ABdhPJz+IiDNNKxLIWGlpPBmprrDTaVAIqywbGpbk23vnsvkMA4GCHINxPDAenRMq2fjRyWU/7H2pA== X-Received: by 2002:a17:902:d2c8:b0:14a:419c:7c46 with SMTP id n8-20020a170902d2c800b0014a419c7c46mr2160007plc.7.1641811202688; Mon, 10 Jan 2022 02:40:02 -0800 (PST) Received: from jrouhaud (1-171-174-202.dynamic-ip.hinet.net. [1.171.174.202]) by smtp.gmail.com with ESMTPSA id h19sm6365512pfh.30.2022.01.10.02.40.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jan 2022 02:40:01 -0800 (PST) Date: Mon, 10 Jan 2022 18:39:57 +0800 From: Julien Rouhaud To: Andrey Lepikhov Cc: PostgreSQL Hackers , Tom Lane Subject: Re: Multiple Query IDs for a rewritten parse tree Message-ID: References: <1606733.1641689399@sss.pgh.pa.us> <20220109121321.3d74krhjbr5mp4zv@jrouhaud> <1ea9d518-becb-1c3d-dc6c-e0045d3101de@postgrespro.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 10, 2022 at 03:24:46PM +0500, Andrey Lepikhov wrote: > On 10/1/2022 13:56, Julien Rouhaud wrote: > > > > I don't know the details of that extension, but I think that it should work as > > long as you have the constants information in the jumble state, whatever the > > resulting normalized query string is right? > Yes. the same input query string doesn't prove that frozen query plan can be > used, because rewrite rules could be changed. So we use only a query tree. Yes, I'm fully aware of that. I wasn't asking about using the input query string but the need for generating a dedicated normalized output query string that would be potentially different from the one generated by pg_stat_statements (or similar). > > But then, if generating 2 queryid is a better for performance, does the > > extension really need an additional jumble state and/or normalized query > > string? > Additional Jumble state isn't necessary, but it would be better for > performance to collect pointers to all constant nodes during a process of > hash generation. I agree, but it's even better for performance if this is collected only once. I still don't know if this extension (or any extension) would require something different from a common jumble state that would serve for all purpose or if we can work with a single jumble state and only handle multiple queryid.