Albe Laurenz | 8 Jun 2012 10:15
Picon
Favicon

Tablespaces and query planning

Could somebody confirm or refute the following statements, please?

- The statistics gathered by ANALYZE are independent of the tablespace
  containing the table.
- The tablespace containing the table has no influence on query planning
  unless seq_page_cost or random_page_cost has been set on the
tablespace.
- VACUUM ANALYZE does the same as VACUUM followed by ANALYZE.

Yours,
Laurenz Albe

--

-- 
Sent via pgsql-performance mailing list (pgsql-performance <at> postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance

Cédric Villemain | 8 Jun 2012 12:36
Favicon

Re: Tablespaces and query planning

> - The statistics gathered by ANALYZE are independent of the tablespace
>   containing the table.

yes.

> - The tablespace containing the table has no influence on query planning
>   unless seq_page_cost or random_page_cost has been set on the
> tablespace.

yes.

> - VACUUM ANALYZE does the same as VACUUM followed by ANALYZE.

no.
it is fine grained, but in the diffs there is:

 VACUUM and ANALYSE do not update pg_class the same way for the 
reltuples/relpages: for ex VACUUM is accurate for index, and ANALYZE is fuzzy 
so if you issue a vacuum you have exact values, if you then run ANALYZE you 
may change them to be less precise.

--

-- 
Cédric Villemain +33 (0)6 20 30 22 52
http://2ndQuadrant.fr/
PostgreSQL: Support 24x7 - Développement, Expertise et Formation
Albe Laurenz | 11 Jun 2012 09:01
Picon
Favicon

Re: Tablespaces and query planning

Cédric Villemain wrote:
> > - The statistics gathered by ANALYZE are independent of the tablespace
> >   containing the table.
> 
> yes.
> 
> > - The tablespace containing the table has no influence on query planning
> >   unless seq_page_cost or random_page_cost has been set on the
> > tablespace.
> 
> yes.
> 
> > - VACUUM ANALYZE does the same as VACUUM followed by ANALYZE.
> 
> no.
> it is fine grained, but in the diffs there is:
> 
>  VACUUM and ANALYSE do not update pg_class the same way for the
> reltuples/relpages: for ex VACUUM is accurate for index, and ANALYZE is fuzzy
> so if you issue a vacuum you have exact values, if you then run ANALYZE you
> may change them to be less precise.

Thanks for the confirmationsand the clarification.  I hadn't thought of the
statistical entries in pg_class.

Yours,
Laurenz Albe

--

-- 
Sent via pgsql-performance mailing list (pgsql-performance <at> postgresql.org)
(Continue reading)


Gmane