Re: performance while importing a very large data set in to database - Mailing list pgsql-performance

From Scott Marlowe
Subject Re: performance while importing a very large data set in to database
Date
Msg-id dcc563d10912051509j61a954efr49ce4cae1dfedf77@mail.gmail.com
Whole thread Raw
In response to Re: performance while importing a very large data set in to database  ("Ing . Marcos Luís Ortíz Valmaseda" <mlortiz@uci.cu>)
List pgsql-performance
On Sat, Dec 5, 2009 at 7:16 AM, "Ing . Marcos Luís Ortíz Valmaseda"
<mlortiz@uci.cu> wrote:
> Ashish Kumar Singh escribió:
>>
>> Hello Everyone,
>>
>>
>> I have a very bit big database around 15 million in size, and the dump
>> file is around 12 GB.
>>
>> While importing this dump in to database I have noticed that initially
>> query response time is very slow but it does improves with time.
>>
>> Any suggestions to improve performance after dump in imported in to
>> database will be highly appreciated!
>>
>>
>>
>>
>> Regards,
>>
>> Ashish
>>
> My suggestion is:
> 1- Afterward of the db restore, you can do a vacuum analyze manually on your
> big tables to erase all dead rows

Well, there should be no dead rows, it's a fresh restore, so just
plain analyze would be enough.  Note that autovacuum will kick in
eventually and do this for you.

> 2- Then you can reindex your big tables on any case that you use it.

Again, a freshly loaded db does not need to be reindexed.  The indexes
are fresh and new and clean.

> 3- Then apply A CLUSTER command on the right tables that have these indexes.

Now that's useful, but if you're gonna cluster, do it FIRST, then
analyze the tables.

pgsql-performance by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: query cost too high, anyway to reduce it
Next
From: Craig Ringer
Date:
Subject: Re: Large DB, several tuning questions: Index sizes, VACUUM, REINDEX, Autovacuum