Re: ANALYZE ONLY - Mailing list pgsql-hackers

From David Rowley
Subject Re: ANALYZE ONLY
Date
Msg-id CAApHDvruUROZVVubW=Qzp8CzB4HEqu_jOuvLd3-nmJHXme+T1A@mail.gmail.com
Whole thread Raw
In response to Re: ANALYZE ONLY  (Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>)
List pgsql-hackers
On Tue, 20 Aug 2024 at 23:25, Ilia Evdokimov
<ilya.evdokimov@tantorlabs.com> wrote:
> Your proposal is indeed interesting, but I have a question: can't your issue be resolved by properly configuring
autovacuuminstead of developing a new feature for ANALYZE?
 

Basically, no. There's a "tip" in [1] which provides information on
the limitation, namely:

"The autovacuum daemon does not issue ANALYZE commands for partitioned
tables. Inheritance parents will only be analyzed if the parent itself
is changed - changes to child tables do not trigger autoanalyze on the
parent table. If your queries require statistics on parent tables for
proper planning, it is necessary to periodically run a manual ANALYZE
on those tables to keep the statistics up to date."

There is also some discussion about removing the limitation in [2].
While I agree that it would be nice to have autovacuum handle this,
it's not clear how exactly it would work. Additionally, if we had
that, it would still be useful if the ANALYZE command could be
instructed to just gather statistics for the partitioned table only.

David

[1] https://www.postgresql.org/docs/devel/routine-vacuuming.html#VACUUM-FOR-STATISTICS
[2] https://www.postgresql.org/message-id/flat/CAKkQ508_PwVgwJyBY%3D0Lmkz90j8CmWNPUxgHvCUwGhMrouz6UA%40mail.gmail.com



pgsql-hackers by date:

Previous
From: Maxim Orlov
Date:
Subject: Re: Test 041_checkpoint_at_promote.pl faild in installcheck due to missing injection_points
Next
From: Ajay Pal
Date:
Subject: Re: SQL Property Graph Queries (SQL/PGQ)