I can`t use COPY or put it in a transaction, because the application which writes in PostgreSQL decides if it`s an INSERT or a UPDATE which depends on different conditions and also manipulate the records. In on extreme case it can be only INSERTs, in the other extreme case all can be UPDATES. Normally the UPDATES are more that INSERTs.

I have to improve the performance of the UPDATES and I was wondering why the UPDATEs need twice as long as the INSERTs.

Greetings
Michaela

----- Original Message ----- From: "Thomas Pundt" <[EMAIL PROTECTED]>
To: <pgsql-general@postgresql.org>
Sent: Tuesday, April 11, 2006 11:30 AM
Subject: Re: [GENERAL] Performance UPDATE/INSERT


Hi,

On Tuesday 11 April 2006 11:08, MG wrote:
| I have about 100 000 records, which need about 30 minutes to write them
| with single INSERTs into PostgreSQL. If I go through these 100 000 records
| and make an UPDATE on each record, it takes 1 hour.
|
| Can anyone tell me, about his experience of the performance of INSERT and
| UPDATE.

how about using COPY for the import? Or at least putting the INSERTs into
a transaction using BEGIN and COMMIT? I would do the same with the UPDATEs:
put it into a transaction frame.

Ciao,
Thomas

--
Thomas Pundt <[EMAIL PROTECTED]> ---- http://rp-online.de/ ----

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match





---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to