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 1oJm5j-0001g6-FR for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Aug 2022 01:25:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oJm5g-0007tv-LZ for pgsql-bugs@arkaria.postgresql.org; Fri, 05 Aug 2022 01:25:28 +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 1oJm5g-0007tm-B3 for pgsql-bugs@lists.postgresql.org; Fri, 05 Aug 2022 01:25:28 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oJm5Z-00075B-Hs for pgsql-bugs@lists.postgresql.org; Fri, 05 Aug 2022 01:25:27 +0000 Received: by mail-pj1-x1034.google.com with SMTP id e8-20020a17090a280800b001f2fef7886eso1415625pjd.3 for ; Thu, 04 Aug 2022 18:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=sLolT9QlKw9kIqp/NaNWHK62X2wtsQWSbir1Bwazo08=; b=f8bedSEQfRWXTwFs1nJb0XYcTCAJ1hlTZF8k+K+0U2CAFJO1397kEzINk2l5BB2ZMP aixvlvNiQqK4qEZl0Fyv91RhU1BhU6eV6arRzdX/LrlxhrYUjfM+Ckpm2mghPJSzKzgd 1nrgURnCRNoP+0lFFktmXZHsXUMlCZGOH2hCsarKWdxqfe5Nkq4VG+MjzZtKSWNhY+g1 nujMzwUsq+EZqPSKsMO1XukEpWqB9tLy3G+M6Bq2suLNDdbPNyIyzx9c0hcyo+b7Ekv+ h/fNWEDP9SWU5H6+YTeoyBkKPSyeT4v6ophWNYvZ0WcMoi5wEAtAFrfzU3CW2N7hkcLm 8wqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=sLolT9QlKw9kIqp/NaNWHK62X2wtsQWSbir1Bwazo08=; b=2+8x/EFiiZdCfOsy75qZ9VatGb5LdwAXcOVwjtxLfhNzii1aFTZM8escRVCipxEYeI ZpJL3e3YrTNQNEnq1/Fd5fmaY2Ks5HOGUkerjb4cPcL3tD4DyNs2HDGbF1l4POpCJzdA uMzPcvBLH7DsT2iund8Zcovy1j5652Hbhfshy0osm69LnZbz6DWWe8jbhnQNMJGpql3J D7NaAas7ko9VoSJHieOtwv2jq2GhyAmZDRDJl3KVgCV3RSkp0hLbaANT3GJ9EWDD3/p9 FOnjl9Pjxj0gwAcLMFaMI7dd4Rif32YqkTWTeqrq2nA8r/gxqoN/CUlgy+SJge+QBu62 /Hwg== X-Gm-Message-State: ACgBeo3m9Fgnvwx+GLEpUQxQE4GIUqsBFvH96fTqJe1FtkOBshVvuPNL SN9pw9ziR2ExLWme2+/hk2l6MIaUzC5FhknJflg= X-Google-Smtp-Source: AA6agR4T1QprGjUjv9mb9tSAAvCzMMpJOAhJ/eerDoqoQTSlJaDJYPcJHnQ1OIm+ZzgJ2axKI8X+Vv5a7SnN6Q9SQDk= X-Received: by 2002:a17:90a:558f:b0:1f5:bbc:c58e with SMTP id c15-20020a17090a558f00b001f50bbcc58emr13235114pji.102.1659662719492; Thu, 04 Aug 2022 18:25:19 -0700 (PDT) MIME-Version: 1.0 References: <17570-f2f2e0f4bccf0965@postgresql.org> <3508845.1659627758@sss.pgh.pa.us> In-Reply-To: <3508845.1659627758@sss.pgh.pa.us> From: Richard Guo Date: Fri, 5 Aug 2022 09:25:08 +0800 Message-ID: Subject: Re: BUG #17570: Unrecognized node type for query with statistics on expressions To: Tom Lane Cc: Japin Li , Tomas Vondra , a.kozhemyakin@postgrespro.ru, PostgreSQL mailing lists Content-Type: multipart/alternative; boundary="000000000000d7a65805e57456b3" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000d7a65805e57456b3 Content-Type: text/plain; charset="UTF-8" On Thu, Aug 4, 2022 at 11:42 PM Tom Lane wrote: > * The comments for statext_is_compatible_clause suck. If they'd > defined what the arguments are, perhaps this mess would have been > prevented. For extra credit, it'd be really nice to define what > "is compatible" means. I'd sure not have thought that that would > include permissions checks. I think by 'compatible' it just means the clause is in the form that can be estimated using MCV lists. Maybe we can define it as that. In statext_is_compatible_clause() we have the permission checks to see if we are allowed to read all required attributes, which indeed needs to be mentioned in the function comments. Thanks Richard --000000000000d7a65805e57456b3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Thu, Aug 4, 2022 at 11:42 PM Tom Lane = <tgl@sss.pgh.pa.us> wrote:
* The comments for statext_is_compatible_clause suck.=C2=A0 If they'd defined what the arguments are, perhaps this mess would have been
prevented.=C2=A0 For extra credit, it'd be really nice to define what "is compatible" means.=C2=A0 I'd sure not have thought that t= hat would
include permissions checks.

I think by '= ;compatible' it just means the clause is in the form that can
be est= imated using MCV lists. Maybe we can define it as that.

In statext_i= s_compatible_clause() we have the permission checks to see
if we are all= owed to read all required attributes, which indeed needs to
be mentioned= in the function comments.

Thanks
Richard
--000000000000d7a65805e57456b3--