Re: [GENERAL] So slow inserts... Why?

From: Charles Tassell <ctassell(at)isn(dot)net>
To: Michal Samek <webmaster(at)tony(dot)cz>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] So slow inserts... Why?
Date: 1999-05-26 18:00:24
Message-ID: 4.1.19990526145834.00917d20@mailer.isn.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Try using transactions. I found when doing single inserts they could take
hours, but when grouping all the inserts into a single transaction, it was
relatively quick. It's been a while, but I believe the syntax is:
BEGIN
insert ...
insert ...
insert ...
COMMIT;

At 11:15 AM 5/26/99, Michal Samek wrote:
>johan(dot)granlund(at)solid(dot)se wrote:
>>
>> As i dont know anything about triggers:)
>> Have you done a vacuum on the databases to clear out old transactions?
>
>I recreated the table, so I think there is not necessary to vacuum it
>(it takes unbelieveable amount of time); maybe when I'm filling the
>table by sending a lot of INSERT queries I should sometimes between
>inserts do a vacuum ? It looks strange for me.
>
>And many thanks for your help; I was thinking about dropping indexes and
>trigger, but It's impossible. Imagine this is not just a series of
>insert queries, the process I'm using is (simplicied): For each dbase
>record (the catalogue from the music label) to look-up if exist and if
>so, update; if no, insert. So I can't drop indexes which are needed by
>look-up function; nor can't drop trigger because it tracks inserts /
>updates of my table.
>I'm testing to group inserts / updates to blocks enclosed with
>transaction BEGIN; END;, but it now looks that it will help only little.
>
>PS I plan to rewrite the whole thing to Mysql (even it's no triggers, it
>will be harder but possible of course) and to report the result here if
>will be interesting)
>
>
>--
>Michal Samek, Tony distribuce s.r.o.
>webmaster(at)tony(dot)cz (++420659/321350)
>ICQ: 38607210
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jackson, DeJuan 1999-05-26 19:01:09 RE: [GENERAL] So slow inserts... Why?
Previous Message Jackson, DeJuan 1999-05-26 17:43:08 RE: [GENERAL] 6.3.2 -> 6.4.2