Re: extended stats on partitioned tables

From: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Zhihong Yu <zyu(at)yugabyte(dot)com>, Jaime Casanova <jcasanov(at)systemguards(dot)com(dot)ec>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: extended stats on partitioned tables
Date: 2022-01-15 19:05:27
Message-ID: 929bd70f-cfc9-6b8e-e827-53555b6d77fe@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2022-01-15 22:57:20 Re: sequences vs. synchronous replication
Previous Message Tom Lane 2022-01-15 18:58:46 Re: Windows: Wrong error message at connection termination