>> 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