Re: ANALYZE after CREATE TABLE AS SELECT...

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Semyon Reyfman <reyfmans(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ANALYZE after CREATE TABLE AS SELECT...
Date: 2015-02-26 22:23:35
Message-ID: 20150226222335.GF2384@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Semyon Reyfman wrote:

> When I create a table with "CREATE TABLE name AS SELECT." statement and
> immediately afterward use this new table in a query does it make sense to
> run ANALYZE on the table in between? It appears that postgres should be
> able to collect very detailed statistics while emitting the table but I am
> not sure if this is done.

It isn't. It also doesn't create any indexes, which you might want to
do before analyze.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2015-02-26 22:34:02 Re: Triggers and scalability in high transaction tables.
Previous Message John R Pierce 2015-02-26 22:17:36 Re: Triggers and scalability in high transaction tables.