pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: nunks <nunks.lol@gmail.com>
Cc: gaoqiangdba@163.com <gaoqiangdba@163.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: ANALYZE'ing table hierarchies
Date: Fri, 19 Feb 2016 09:01:23 -0500
Message-ID: <12848.1455890483@sss.pgh.pa.us> (raw)
In-Reply-To: <CACq6szS7SYipf4dicE24+E8yTP2Am=6XF_Q8Akjfq7j2x1-2Pg@mail.gmail.com>
References: <CACq6szTXye=LzyFHnfYe-zZFZ-=TTG45uECs_o5_qOArfB=RZQ@mail.gmail.com>
	<201602191441422069485@163.com>
	<CACq6szQehp21577Qs57yRae5gtYgUXx0-TOQcDTohiro6--OVA@mail.gmail.com>
	<11677.1455888766@sss.pgh.pa.us>
	<CACq6szS7SYipf4dicE24+E8yTP2Am=6XF_Q8Akjfq7j2x1-2Pg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

nunks <nunks.lol@gmail.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


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (6+ messages)

Message-ID: <12848.1455890483@sss.pgh.pa.us>
Permalink:  ../12848.1455890483@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/12848.1455890483@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, nunks.lol@gmail.com, gaoqiangdba@163.com
  Subject: Re: ANALYZE'ing table hierarchies
  In-Reply-To: <12848.1455890483@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox