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 1n8oMr-00038e-9j for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Jan 2022 19:05:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n8oMq-0006UT-20 for pgsql-hackers@arkaria.postgresql.org; Sat, 15 Jan 2022 19:05:36 +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 1n8oMp-0006UJ-CX for pgsql-hackers@lists.postgresql.org; Sat, 15 Jan 2022 19:05:35 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n8oMl-00069Z-9I for pgsql-hackers@postgresql.org; Sat, 15 Jan 2022 19:05:34 +0000 Received: by mail-wm1-x32d.google.com with SMTP id k5so3241882wmj.3 for ; Sat, 15 Jan 2022 11:05:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language :from:to:cc:references:in-reply-to:content-transfer-encoding; bh=LG9dCmongAyk5aePUpDO4HQpCoWyu+Bxs68AOrTRa6s=; b=HlaitJkhl1MC5SLzRbUqWYApHhE8ICCc0b50azg8dnVi4RtSQEHRjmVoLKbllDX50T /murBsjBfqkzzUsDlBnCGJINIX/aMADVpR0XTQTY4K9YsK6IpDLhdQyWXNR+jv6Ra10h aiWSCAEtlsrqFhmr6pltE4ur5oEMU/JkCv2Pc3xRJyjOQpw8dsYDz1LAqVREhO8iZWhw VIgQ3IMRxBSA2Wl87+kx5R3wjUaRDfXWow5p1bN6nJJmeNI/4VwIZndmcyk8XPMLTOIP AFgaAz2PxncxbN9O167znRsjAxfcs8IwBPMYmwjh/YJltSd7pPF6wDBwrjBdQiHC5dX3 Gzuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:from:to:cc:references:in-reply-to :content-transfer-encoding; bh=LG9dCmongAyk5aePUpDO4HQpCoWyu+Bxs68AOrTRa6s=; b=PKfRN6AUlnkCq9qgsTQ25EMVfpqBfrLmkTr2r4q0rYVkPcNfeyswKImzbkIBMrbKMK o/4zkrZc4MCbAEklBW5G30b8ixgPGoakCOMME8afScGLd+TAPMjiWlLJcDlrwY0uj6U0 J444Ixgeeh0rLQ7jtRw9c44ooIgm2ybLqK068JKB/bvTkyk568561r2hDOOIUw9KnuNS BaNn/ASj3eQTWRBS2BPfqXsDR/T3YVwe1aOHnAnOdO1KIEiyaJwwZPVHJ2XmeAXI8Ex0 wArf6wXfAoU8GDQed6Gi4aiEXpmgDQe4IstCiG3ZSSfcPG1Yg2QSz9CLZOYZ2juc6naJ bUzQ== X-Gm-Message-State: AOAM530LYaV0OJt33HapV9wq4KWUBje2Q1g+MQNEsBNpfsCZY9Hurwn7 NWucIfxKQeb+Qm2tLvCBqRFL04p63D7P33H2jn9NRrgnuUffWWMpr4VM6oJedI2R1wjBOz3cPY0 QZ0y+/S3dffN8zgEksyjw29R6x1W/P1CFiTCLZXP+fJRExcnmoVMn9i8QamDFxuz+jhf6jJEICu NE+ry+x6JTo/r95PTWNhnprSKDNO1fstvZAanC X-Google-Smtp-Source: ABdhPJy2EQDGKTADCvmnyqfZrAZpSBOcCS7CpifRM0I/fVzlSdMxn/dJ1tA6FqD5WI3hpHeXdqjm9w== X-Received: by 2002:a05:600c:3589:: with SMTP id p9mr12616592wmq.109.1642273529858; Sat, 15 Jan 2022 11:05:29 -0800 (PST) Received: from [10.137.0.18] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id b14sm1410556wri.62.2022.01.15.11.05.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Jan 2022 11:05:29 -0800 (PST) Message-ID: <929bd70f-cfc9-6b8e-e827-53555b6d77fe@enterprisedb.com> Date: Sat, 15 Jan 2022 20:05:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: extended stats on partitioned tables Content-Language: en-US From: Tomas Vondra To: Justin Pryzby Cc: Zhihong Yu , Jaime Casanova , pgsql-hackers@postgresql.org References: <46f37069-55cb-db6a-a15a-e351a2606592@enterprisedb.com> <20211103231904.GP17618@telsasoft.com> <689accb1-76e8-5115-6ed0-336749cdca57@enterprisedb.com> <20211203052411.GU17618@telsasoft.com> <8052505e-2dd2-e8cb-26c9-cbb5dff7d750@enterprisedb.com> <20211212213210.GP17618@telsasoft.com> <20211213135348.GT17618@telsasoft.com> <20220115051138.GR14051@telsasoft.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed 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 1/15/22 19:35, Tomas Vondra wrote: > On 1/15/22 06:11, Justin Pryzby wrote: >> On Mon, Dec 13, 2021 at 09:40:09PM +0100, Tomas Vondra wrote: >>> 1) If the table is a separate relation (not part of an inheritance >>> tree), this should make no difference. -> OK >>> >>> 2) If the table is using "old" inheritance, this reverts back to >>> pre-regression behavior. So people will keep using the old statistics >>> until the ANALYZE, and we need to tell them to ANALYZE or something. >>> >>> 3) If the table is using partitioning, it's guaranteed to be empty and >>> there are no stats at all. Again, we should tell people to run ANALYZE. >> >> I think these can be mentioned in the commit message, which can end up >> in the >> minor release notes as a recommendation to rerun ANALYZE. >> > > Good point. I pushed the 0002 part and added a short paragraph > suggesting ANALYZE might be necessary. I did not go into details about > the individual cases, because that'd be too much for a commit message. > >> Thanks for pushing 0001. >> > > Thanks for posting the patches! > > I've pushed the second part - attached are the two remaining parts. I'll > wait a bit before pushing the rebased 0001 (which goes into master > branch only). Not sure about 0002 - I'm not convinced the refactored ACL > checks are an improvement, but I'll think about it. > BTW when backpatching the first part, I had to decide what to do about tests. The 10 & 11 branches did not have the check_estimated_rows() function. I considered removing the tests, reworking the tests not to need the function, or adding the function. Ultimately I added the function, which seemed like the best option. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company