Re: INSERT performance deteriorates quickly during a large import - Mailing list pgsql-general

From Tomas Vondra
Subject Re: INSERT performance deteriorates quickly during a large import
Date
Msg-id 4734CA4B.3040102@fuzzy.cz
Whole thread Raw
In response to Re: INSERT performance deteriorates quickly during a large import  (Chris Browne <cbbrowne@acm.org>)
List pgsql-general
>> Try to one of these:
>>
>> a) don't use INSERT statements, use a COPY instead
>>
>> b) from time to time run ANALYZE on the "public" table (say 1000
>>    inserts, then one analyze)
>>
>> c) create the table without constraints (primary / foreign keys in this
>>    case), import all the data, and then create the constraints
>>
>> The (b) and (c) may be combined, i.e. import without constraints and
>> analyze from time to time. I'd probably try the (a) at first, anyway.
>>
>> Try to gather some more statistics - is the problem related to CPU or
>> I/O? Use 'dstat' for example - this might say give you a hint in case
>> the advices mentioned above don't help.
>
> I agree with all but b).

You're right - this combination (no constraints or indices and using
ANALYZE at the same time) won't help. The original list of advices was a
little bit different, but I've changed it and haven't checked the
following paragraphs ...

Tomas

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Optimal time series sampling.
Next
From: Nathan Wilhelmi
Date:
Subject: Importance of CPU floating point performance...