ANALYSE on top-level of partitioned tables - required?

Поиск
Список
Период
Сортировка
Искать

ANALYSE on top-level of partitioned tables - required?

От:
Toby Corkindale <toby.corkindale@strategicdata.com.au>
Дата:
Hi,
Say you have a master table which has many partitioned tables, created 
like this:

CREATE TABLE foo (various columns...);
CREATE TABLE foo_1 () INHERITS foo;
CREATE TABLE foo_2 () INHERITS foo;

Now lets say you insert data directly into foo_X, eg with
COPY foo_1 FROM...
COPY foo_1 FROM...

Do you need to manually call ANALYZE manually on foo for PostgreSQL to 
build statistics on it?

I remember seeing something in the documentation about how the 
auto-analyser won't realise it needs to run on top-level tables because 
as far as its concerned, there have been no changes to it..

But, I wondered if that matters? I mean, since there's no data in it, 
but all the child tables are analysed, is that enough?


My experience so far indicates that it DOES matter (looking at query 
plans before and after calling ANALYSE), but I'd like to get some 
opinions from those more knowledgeable than I..

thanks in advance,
Toby
FAQ