Re: [GENERAL] ANALYZE after CREATE TABLE AS SELECT...

2015-02-26 Thread Semyon Reyfman
Subject: Re: [GENERAL] ANALYZE after CREATE TABLE AS SELECT... On 2/26/15 2:05 PM, Tom Lane wrote: > "Semyon Reyfman" writes: >> When I create a table with "CREATE TABLE name AS SELECT." statement >> and immediately afterward use this new table in a query does

Re: [GENERAL] ANALYZE after CREATE TABLE AS SELECT...

2015-02-26 Thread Tom Lane
David Steele 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

Re: [GENERAL] ANALYZE after CREATE TABLE AS SELECT...

2015-02-26 Thread David Steele
On 2/26/15 5:23 PM, Alvaro Herrera wrote: > 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 >>

Re: [GENERAL] ANALYZE after CREATE TABLE AS SELECT...

2015-02-26 Thread David Steele
On 2/26/15 2:05 PM, Tom Lane wrote: > "Semyon Reyfman" writes: >> 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 new table in between? > > Yes. Yes. And to be more specifi

Re: [GENERAL] ANALYZE after CREATE TABLE AS SELECT...

2015-02-26 Thread Alvaro Herrera
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 em

Re: [GENERAL] ANALYZE after CREATE TABLE AS SELECT...

2015-02-26 Thread Tom Lane
"Semyon Reyfman" writes: > 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 new table in between? Yes. regards, tom lane -- Sent via pgsql-general ma