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 1mLWLa-0005DC-3d for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 19:56:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mLWLY-0000KD-TJ for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 19:56:32 +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 1mLWLX-0000K5-Rq for pgsql-hackers@lists.postgresql.org; Wed, 01 Sep 2021 19:56:32 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mLWLS-0004yp-On for pgsql-hackers@postgresql.org; Wed, 01 Sep 2021 19:56:30 +0000 Received: by mail-wr1-x436.google.com with SMTP id v10so1370906wrd.4 for ; Wed, 01 Sep 2021 12:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=9EpwHii9QNknMDQ3YU7qKBwPTxcD1VqrYxHZKR0z0KI=; b=O2aF2LrUKDVlyILsXWvIeBhayr0s2auKcoU5X/yCSkI+ZUUCyDVRRcjPwlgAQFxmvV WLas8KfVcitSmWVS1V6gKyB4YMS6+mSdtMYePVmGSh2g1WceajpbvSO/9EWiwCobXI7V sdsTJa4/7n9OFHuvM4z/lxVZZqxEBok396NR7A/bM8RCCpb6x/UkLGfsfq+r17C7gp+V OR7Ds761eOgJYnYwYN+zYc3p0r2Re93HWbJc70QixJrT5Bx/V5J2htyYWiIrOinr2qMv IKqhWmbvqJcyFVBuA0JiZN52t36odg+2HrBxeSRiYOOeyIjZKu4YQFU5zIBcgS5zuQDG GdWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9EpwHii9QNknMDQ3YU7qKBwPTxcD1VqrYxHZKR0z0KI=; b=YiOPjfznx02k9sli0xIOsQft2BOeAGn4eH1CF/0fiGkm/PwQBSQyQnZcUgIBUf1Mov iRkax1wKtKFseM5FZIl4xV8UCf5uY4vp6MevZNf0fEm+Jr/Mv1joBmc0zNxwbt6Diz7V 9WpYNfYtUkjM+QnT9BFyabqiMNzFwDcfRdTExRORtPeynFvLW1CdiMg5HanTHvVicSSs R+LfuaIXRkzObgod0I/CT52ZEuOXdU+WUsttjxJjDnr63vBGT3/K+Wji/EWoW/ygwNau L9hRysOFzDBdzdgnnl3tJu8geQst3uU2Ko9ffO88OsT3U8s6Pe2EVPsMx8MIPAav2zVr jJVQ== X-Gm-Message-State: AOAM531gJCMGKCaLVbmYdSJ6nTpZOQPPvCnwYs4FJ5I9FoKRiOUXQqkX tu2yZgy3OaydYnUzck1qS2aicwbzvgTZMwIaoRo2lHUvTXjcyTVkUA/e/TqDPb3B8fjE0bfsjJc TUqLbZJZC/SUgkIgLsfB1COzjS5VbVQxPn3DZ+tJXII+NS3BbMhO5GU/WoqS7sx5Qr2ZxkkmHP2 Z/t1OykBhIwB3a2s4cMIxQwS1IcWXLYVND4q02XP3sHhQLUQOXL2Ta2QG9VdXZNisbHI8SIYg6t IKWILH8Dr+vg0mCvt/0r5hj323ol6BP9t1wMw== X-Google-Smtp-Source: ABdhPJwRY8jFcR9TA/hMmCYtSNz46H4/Kaz4YUxOpaR71d03h2oYLodR2kYl9juZKuY37yLqHNxZFg== X-Received: by 2002:adf:ed0c:: with SMTP id a12mr1237233wro.102.1630526184793; Wed, 01 Sep 2021 12:56:24 -0700 (PDT) Received: from [10.137.0.18] (ip-86-49-241-1.net.upcbroadband.cz. [86.49.241.1]) by smtp.gmail.com with ESMTPSA id s12sm404870wru.41.2021.09.01.12.56.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Sep 2021 12:56:24 -0700 (PDT) Subject: Re: PoC/WIP: Extended statistics on expressions To: Justin Pryzby Cc: Dean Rasheed , hackers References: <20201123022604.GD24052@telsasoft.com> <6455e0ad-2a2e-bdb0-e1f8-fd4983d1c8aa@enterprisedb.com> <087086de-1384-8374-4efc-2e7915071d5c@enterprisedb.com> <20210816013255.GS10479@telsasoft.com> <20210824131320.GO10479@telsasoft.com> <6bc0ab0c-a807-2b7f-7df8-ac90c7839013@enterprisedb.com> <20210901193816.GO26465@telsasoft.com> From: Tomas Vondra Message-ID: <7d3c842e-778e-d780-94da-f216c1002d14@enterprisedb.com> Date: Wed, 1 Sep 2021 21:56:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210901193816.GO26465@telsasoft.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/1/21 9:38 PM, Justin Pryzby wrote: > On Wed, Sep 01, 2021 at 06:45:29PM +0200, Tomas Vondra wrote: >>>> Patch 0001 fixes the "double parens" issue discussed elsewhere in this >>>> thread, and patch 0002 tweaks CREATE STATISTICS to treat "(a)" as a simple >>>> column reference. >>> >>> 0002 refuses to create expressional stats on a simple column reference like >>> (a), which I think is helps to avoid a user accidentally creating useless ext >>> stats objects (which are redundant with the table's column stats). >>> >>> 0002 does not attempt to refuse cases like (a+0), which I think is fine: >>> we don't try to reject useless cases if someone insists on it. >>> See 240971675, 701fd0bbc. >>> >>> So I am +1 to apply both patches. >>> >>> I added this as an Opened Item for increased visibility. >> >> I've pushed both fixes, so the open item should be resolved. > > Thank you - I marked it as such. > > There are some typos in 537ca68db (refenrece) > I'll add them to my typos branch if you don't want to patch them right now or > wait to see if someone notices anything else. > Yeah, probably better to wait a bit. Any opinions on rejecting expressions referencing system attributes or no attributes at all? regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company