Re: ANALYZE'ing table hierarchies

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nunks <nunks(dot)lol(at)gmail(dot)com>
Cc: "gaoqiangdba(at)163(dot)com" <gaoqiangdba(at)163(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: ANALYZE'ing table hierarchies
Date: 2016-02-19 14:01:23
Message-ID: 12848.1455890483@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

nunks <nunks(dot)lol(at)gmail(dot)com> writes:
> I deal with some big (TB-level) partitioned tables where the application
> does a hybrid of querying both the master and the child tables directly.
> This clarification will be very useful.

BTW, the autovacuum daemon is normally fairly good about analyzing
tables when the individual-table stats need updating (or if you think
it isn't, you can adjust its parameters to make it more or less
aggressive about that). Where it falls down is actually in maintenance
of whole-tree stats: it does not realize that a bunch of updates on a
child table should prompt auto-analyze of the parent table as well as
the child. So I'd actually not think that you need to worry too much
about manual ANALYZEs of the children. You might indeed need to help
things out with periodic manual ANALYZEs of the parent table, though.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Evan Rempel 2016-02-19 15:52:25 Re: 9.5 new setting "cluster name" and logging
Previous Message Fujii Masao 2016-02-19 13:56:56 Re: 9.5 new setting "cluster name" and logging