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 1t1ziE-001NGk-Kl for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Oct 2024 03:01:06 +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 1t1ziA-00E2AH-Ks for pgsql-hackers@arkaria.postgresql.org; Sat, 19 Oct 2024 03:01:03 +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 1t1ziA-00E21n-AN for pgsql-hackers@lists.postgresql.org; Sat, 19 Oct 2024 03:01:02 +0000 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t1zi3-001dTH-Sw for pgsql-hackers@postgresql.org; Sat, 19 Oct 2024 03:01:01 +0000 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-a9a0f198d38so362109466b.1 for ; Fri, 18 Oct 2024 20:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729306854; x=1729911654; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zgbBnbbfbWm7TyJvdad2yeYVlRoXmKtkq+Z2Rj/AWDc=; b=AeOY1gLqHeezv6hzyhXPijyzc22s0/NyyAE2mSw1pBQZ1R9vqai3xOr08zeJqFWvag Sdcnb0HD0EyUWklslkM5oeJxWP0VVI5F97umIJ+hNIKfh5vg0QkOiZuvW7hh2LTV8cD6 wwbK1+ts4xHXUVb655BJZTlT0YN2imxD84Xdoy2ZolvHbr0fWsYWdKPJ9y1fAT1I4QHt NVtcR5jKsOIBZifsI84ilP32rbA8a8mAxk0kODUrybsWglUzEiJ4Zfk4P8rF6k8P3EYz fxEIr03NdhMcpB0AcxZeDxTXmVQ2QarLUsheJdFk+Ub4DGR80WgxNYNWnP8RkP5Wz4yH ycWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729306854; x=1729911654; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zgbBnbbfbWm7TyJvdad2yeYVlRoXmKtkq+Z2Rj/AWDc=; b=wwPhU4WXc3DKIKMbV4aO8fKBJOyz6q69pR5yihX+WAAnFdcTsEbQioTvLoZucG9vET fM1XZ3j59m+rBoxz3fibK2ZQlOwFlsoz/bHQks56ZkOC/4G3u5wqUzeANjn6XE9Dg4/R nL4ZSdP1SNctKZZUJMLaZTa0SGf9FrfrFucYo+jUo6oT7ea/q8nE9GYGkpb1ZH2A2X5Y CgyRjBXF0tohUNr72Z2bAbRsJGJqBx58pBUwCxLpMKmrKcEXmND6ci1AlLyjkF+r/vQK UDQ6IsU0myG/Bl7haW5M3tEDNHxuJXZ+Z6/dtS3h8hNBqWO9x/eqwFsOMzmlhHzL330V CEsw== X-Forwarded-Encrypted: i=1; AJvYcCVMIoqLyx3ecgUmrsBU7iL3o5PpagVfB7dzd4bsqtIVRePKXM7OTyldaGP1namhgjdf9nVE2ukTGBsoU3Fd@postgresql.org X-Gm-Message-State: AOJu0Yxl6nBz1ZhXnOAurCty9JQBmLhkBcfXjn80scOftPBrpTNw+9BW RExQU9evlDhgHu+1PQwDT6TXfiy7mHtQ8z/UccANR4ps9oy5PBRP X-Google-Smtp-Source: AGHT+IFiEel6hQb+/Vb82Pmr9tsXiypJRV59Wm6vVeE25CWuBg7gqG+34QYABfs94/OBq7dfglVvgA== X-Received: by 2002:a17:907:6d0b:b0:a77:c30c:341 with SMTP id a640c23a62f3a-a9a694c71b9mr444841366b.0.1729306853768; Fri, 18 Oct 2024 20:00:53 -0700 (PDT) Received: from [10.219.182.41] ([5.195.40.6]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a68bc452asm162985066b.137.2024.10.18.20.00.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 18 Oct 2024 20:00:53 -0700 (PDT) Message-ID: Date: Sat, 19 Oct 2024 07:00:43 +0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: allowing extensions to control planner behavior To: Jakub Wartak Cc: Robert Haas , "pgsql-hackers@postgresql.org" , Tom Lane References: <2909615.1724693854@sss.pgh.pa.us> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 18/10/2024 14:56, Jakub Wartak wrote: > Hi Andrei, > > On Fri, Oct 11, 2024 at 8:21 AM Andrei Lepikhov > wrote: > out of curiosity, why do You think it would be inappropriate to do so in > the core? Maybe it Is something similiar to compute_query_id that can be > computed externally too. Generally, a hash value doesn't 100% guarantee the uniqueness of a node identification. Also, RelOptInfo corresponds to a subtree in the final plan, and sometimes, it takes work to find which node in the partially executed plan corresponds to this specific estimation on row number during selectivity estimation. Remember parameterised paths - you should attach some signature for each path. So, it is not fully strict method. If you are interested, I can perhaps explain the method a little bit more at some meetup. > I remember Tom arguing that query_id should be > computed externally by extension for some reasons because each extension > may want differently to fingerprint the queries, but I cannot find link > to discussion now or bring more details) I argued a lot about allowing extensions to provide separate query_ids and came up with the patch a year ago. But it needs more debate on use cases - my use cases are primarily from enterprise-grade closed extensions, and it doesn't convince anyone. Also, I think any query_id should be generated, likewise the core-made one. Does it seem like an extensible Perl script? -- regards, Andrei Lepikhov