Re: ANALYZE after CREATE TABLE AS SELECT... - Mailing list pgsql-general

From Tom Lane
Subject Re: ANALYZE after CREATE TABLE AS SELECT...
Date
Msg-id 8445.1425000292@sss.pgh.pa.us
Whole thread Raw
In response to Re: ANALYZE after CREATE TABLE AS SELECT...  (David Steele <david@pgmasters.net>)
List pgsql-general
David Steele <david@pgmasters.net> writes:
> On 2/26/15 5:23 PM, Alvaro Herrera wrote:
>> It isn't.  It also doesn't create any indexes, which you might want to
>> do before analyze.

> Is it necessary to create indexes before analyzing?

> I usually do, just to be safe, but I thought statistics were based
> solely on sampling of the heap.

ANALYZE pays no attention to plain indexes.  If you have any expression
indexes, it will collect stats for those expressions.

            regards, tom lane


pgsql-general by date:

Previous
From: David Steele
Date:
Subject: Re: ANALYZE after CREATE TABLE AS SELECT...
Next
From: Michael Paquier
Date:
Subject: Re: Triggers on foreign Postgres 9.3 tables in Postgres 9.4