Re: ANALYZE ONLY - Mailing list pgsql-hackers

From David Rowley
Subject Re: ANALYZE ONLY
Date
Msg-id CAApHDvqnDMk6e=XHNspo5-NT+Pr2bAzdi+HtBu8gx9S3F5NQUw@mail.gmail.com
Whole thread Raw
In response to Re: ANALYZE ONLY  (Michael Harris <harmic@gmail.com>)
Responses Re: ANALYZE ONLY
List pgsql-hackers
On Thu, 22 Aug 2024 at 11:32, Michael Harris <harmic@gmail.com> wrote:
> One other thing I noticed when reading the code. The function
> expand_vacuum_rel in vacuum.c seems to be responsible for adding the
> partitions. If I am reading it correctly, it only adds child tables in
> the case of a partitioned table, not in the case of an inheritance
> parent:
>
>         include_parts = (classForm->relkind == RELKIND_PARTITIONED_TABLE);
> ..
>         if (include_parts)
>         {
>         .. add partitions ..
>
> This is a little different to some other contexts where the ONLY
> keyword is used, in that ONLY would be the default and only available
> mode of operation for an inheritance parent.

That's inconvenient and quite long-established behaviour. I had a look
as far back as 9.2 and we only analyze parents there too. I'm keen on
the ONLY syntax, but it would be strange if ONLY did the same thing as
not using ONLY for inheritance parents.

I feel like we might need to either bite the bullet and make ONLY work
consistently with both, or think of another way to have ANALYZE not
recursively gather stats for each partition on partitioned tables.
Could we possibly get away with changing inheritance parent behaviour?

David



pgsql-hackers by date:

Previous
From: Michael Harris
Date:
Subject: Re: ANALYZE ONLY
Next
From: Tom Lane
Date:
Subject: Re: ANALYZE ONLY