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 1mwSvd-00044x-KQ for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Dec 2021 17:46:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mwSv5-0003Ij-2B for pgsql-hackers@arkaria.postgresql.org; Sun, 12 Dec 2021 17:45:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mwSv4-0003Ia-E6 for pgsql-hackers@lists.postgresql.org; Sun, 12 Dec 2021 17:45:54 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mwSux-0003AV-9Z for pgsql-hackers@postgresql.org; Sun, 12 Dec 2021 17:45:53 +0000 Received: by mail-ed1-x52d.google.com with SMTP id l25so45651083eda.11 for ; Sun, 12 Dec 2021 09:45:46 -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:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=1yDkReiMKXcBDk/+Gt6AGheoIF7aAH1PtgMosCY2LSA=; b=E7kBW0j1tYHBxCMnDvRddUldDkPSvrDR2yR4dCecn9n0Z3y38VymHsy5Gx3EZa+hlv VNmWMHdGIgzMqFXjlXbOw/XqV3ors8Q4sNG26fz059IGpWOzByJsKx0vxAtknDfhLIqy FRUzZZHBKru9iJFCqH0YpBu2mG32Y+XEKCB5g4SRuU3EwV8L488UD/QgdFMT/PO3bISL gcVi21JJQHuP6wUiDgElCkcW8w9fGm/S5H1g9ARSlg0T08kwHIcX3MbNxngw2020M0Md bPvb7tLqvR0ZgZhyFW+lnaQsOngky8gDh7xJNPOlJcZzoH9sGHpW+6/7G7MtULYIG1GG fR8Q== 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:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=1yDkReiMKXcBDk/+Gt6AGheoIF7aAH1PtgMosCY2LSA=; b=izorJvSgnGKhZkCeQD/FM5mtf1trKMXvqdEedsCxhvaZ3W3XnL7z6j8wfjzuOsYnJl gNejyZL4AJg5gSwuu136iTFFjqhdthVQ6bscR+vJ6M4Y75c9TSxEqtmlALSe4mDs7QDT iyWQlCh/2R7Ri2QWN0sYsPd/KPItVP4bdWAgHYVCGtq9Syptjz/7jRikwK1aBoYZSQch HLXiT9K3iTxScQYFK2zY9//BgjfDJKKITlJpOh9UStdlgYzrKiTPlU6QzxpFI1sntG6c EBEL2eKqUIO9ICC9LpUVoKguJSPq5C5LVrlgtF8tE4BnXNUXKkm/U6DHZbFBjA+BGOz0 inPw== X-Gm-Message-State: AOAM530P36Uj4zKVracfLJgceVP2jmTWll7Il0oBI+nmYeaj8nHJIGMg iXuZKc9p4mn2qxNKIBc4DbIBDhI1T/nz5EzumgodyOE7fr1ejaHlnF0GCStessxsZXQ49PSYGPm o1kEoAcVj6wRAm3QhvPqKPPthewtSxePCzTokAoTR3/d0j7oaDTZiL3s1ZLCEJ/oafECrkvgL2F Vh2VHDCISRqd/Hg2/6pbCpMd/lYgh/b2C0lVBU X-Google-Smtp-Source: ABdhPJxDouDsHT9bH5MCdR2eweBRTDIQTcREN7kla7MGNeCDFraB9TNYLWit3UzoVPkof2hK6nYeHw== X-Received: by 2002:aa7:c415:: with SMTP id j21mr57951776edq.357.1639331145484; Sun, 12 Dec 2021 09:45:45 -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 u16sm4961293edr.43.2021.12.12.09.45.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 12 Dec 2021 09:45:45 -0800 (PST) Message-ID: Date: Sun, 12 Dec 2021 18:45:43 +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 To: Zhihong Yu Cc: Justin Pryzby , Jaime Casanova , PostgreSQL-development References: <20210923212624.GI831@telsasoft.com> <20210925223152.GA7877@telsasoft.com> <20210926202550.GA831@telsasoft.com> <20211007202646.GA9522@ahch-to> <20211007224543.GH27491@telsasoft.com> <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> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 12/12/21 14:47, Zhihong Yu wrote: > > > On Sat, Dec 11, 2021 at 9:14 PM Tomas Vondra > > > wrote: > > ... > > > +       /* skip statistics with mismatching stxdinherit value */ > > +       if (stat->inherit != rte->inh) > > > > Should a log be added for the above case ? > > > > Why should we log this? It's an entirely expected case - there's a > mismatch between inheritance for the relation and statistics, simply > skipping it is the right thing to do. > > > Hi, > I agree that skipping should be fine (to avoid too much logging). > I'm not sure it's related to the amount of logging, really. It'd be just noise without any practical use, even for debugging purposes. If you have an inheritance tree, it'll automatically have one set of statistics for inh=true and one for inh=false. And this condition will always skip one of those, depending on what query is being estimated. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company