pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dirk Lutzebaeck <lutzeb@aeccom.com>
To: pgsql-sql@hub.org
Subject: best strategy doing a large copy and using indexes
Date: Tue, 11 Jan 2000 16:21:51 +0100 (CET)
Message-ID: <14459.19087.735901.684613@ampato.aeccom.com> (raw)


I have a table with 7 individual indexes (it models an object store
with different types) and need to copy large data lists into this
table regularly. I'm using COPY for it but it is unacceptable slow
(4min for 1000 rows on a Linux/PII-400). I'm anticipating more than
20000 rows to copy. What combination of the following options is the
best strategy to make this more efficient?

a) drop indexes before COPY and recreate them after COPY

b) put COPY in a transaction

c) do VACUUM before (or after?)

d) do VACUUM ANALYZE before (or after?)

e) COPY to temp table and then make an INSERT SELECT FROM temp table

f) anything else


I'm using -f for the backend already.

Dirk








view thread (2+ messages)  latest in thread

Message-ID: <14459.19087.735901.684613@ampato.aeccom.com>
Permalink:  ../14459.19087.735901.684613@ampato.aeccom.com/
Also on:    postgresql.org/message-id/14459.19087.735901.684613@ampato.aeccom.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: lutzeb@aeccom.com, pgsql-sql@hub.org
  Subject: Re: best strategy doing a large copy and using indexes
  In-Reply-To: <14459.19087.735901.684613@ampato.aeccom.com>
  References: <14459.19087.735901.684613@ampato.aeccom.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox