On Thu, Aug 6, 2026 at 11:31 PM Daniel Gustafsson <[email protected]> wrote:
> I had a look at this open item today and the proposal and patch looks good to
> me.  Just one small comment: don't we need a check for the applicable server
> version (as per the attached v2) before issuing ANALYZE ONLY since it's not
> supported in all versions?

Yes, you're right! Thanks!

I made one small cosmetic change to the version check so that it now reads:

    if (use_only && serverVersion >= 180000)

I also updated the commit message to mention that vacuumdb falls back to
plain ANALYZE on older servers, and to clarify the behavior when
partitioned tables are selected via schema filters.
Attached is an updated v3 patch. Barring any objections, I'll commit it.

While looking at this, I found one related point.  This patch only uses
ANALYZE ONLY for partitioned tables.  However, since v18, plain ANALYZE
on an inheritance parent also recursively analyzes its inheritance
children.  Therefore, when vacuumdb automatically enumerates both an
inheritance parent and its child tables, the child tables can still be
analyzed twice: once via the parent and once as separately selected
targets.

This seems similar to the partitioned-table issue fixed here, but
it strikes me as an enhancement rather than a stabilization fix for v19.
If we decide to address it, I think it would be better targeted at v20.
Does that sound reasonable?

Regards,

-- 
Fujii Masao

Attachment: v3-0001-vacuumdb-Use-ANALYZE-ONLY-for-partitioned-tables.patch
Description: Binary data

Reply via email to