Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uhNQY-00DsWB-3s for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Jul 2025 07:10:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uhNQW-00E4Kz-15 for pgsql-hackers@arkaria.postgresql.org; Thu, 31 Jul 2025 07:10:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uhNQV-00E4Kr-KD for pgsql-hackers@lists.postgresql.org; Thu, 31 Jul 2025 07:10:07 +0000 Received: from mail.postgrespro.ru ([93.174.132.70]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uhNQT-001gXK-1r for pgsql-hackers@postgresql.org; Thu, 31 Jul 2025 07:10:06 +0000 Received: from [192.168.15.242] (unknown [80.251.191.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: a.lepikhov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 03DF260C46; Thu, 31 Jul 2025 10:10:01 +0300 (MSK) Message-ID: <5d6806ac-d74b-4563-9fc5-a7f0958b4ba2@gmail.com> Date: Thu, 31 Jul 2025 09:10:00 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: track generic and custom plans in pg_stat_statements To: Sami Imseih Cc: Michael Paquier , Tom Lane , Greg Sabino Mullane , pgsql-hackers , Nikolay Samokhvalov , Ilia Evdokimov References: <1673684.1753379027@sss.pgh.pa.us> <1933906.1753462272@sss.pgh.pa.us> <87249b23-c4c5-4c0b-88d3-efb13b8a04d1@gmail.com> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2025/07/31 04:00:00 #27639100 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 30/7/2025 22:09, Sami Imseih wrote: > The concepts of custom and generic plan types are associated with plan caches, > so they cannot have a different source. right? That is exactly what confused me: what does the 'origin' of the plan mean? See the comment: > PlannedStmtOrigin identifies from where a PlannedStmt comes from. The first thing that comes to mind after reading this comment is a subsystem, such as the SPI, simple or extended protocol, or an extension. Another meaning is a type of plan, such as 'custom', 'generic', or 'referenced'. As I see, here is a bit different classification used, not so obvious, at least for me. -- regards, Andrei Lepikhov