Re: Insert Performance - Mailing list pgsql-hackers

From Michael Paesold
Subject Re: Insert Performance
Date
Msg-id 031f01c264da$22729d20$4201a8c0@beeblebrox
Whole thread Raw
In response to Re: Improving speed of copy  ("Shridhar Daithankar" <shridhar_daithankar@persistent.co.in>)
Responses Re: Insert Performance
List pgsql-hackers
Tom Lane wrote:

> "Michael Paesold" <mpaesold@gmx.at> writes:
> > To insert another 10562 rows takes about 12 minutes now!!!
>
> See
> http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/populate.html
> particularly the point about not committing each INSERT as a separate
> transaction.
>
> regards, tom lane

As I said I wrote a function to insert the rows (PL/pgSQL). All values were
inserted inside a single function call; I always though that a function call
would be executed inside a transaction block. Experience says it does.

About the other points in the docs:

> Use COPY FROM:
Well, I am currently comparing INSERT to COPY ... ;)

> Remove Indexes:
Doesn't COPY also have to update indexes?

> ANALYZE Afterwards:
I have done a VACUUM FULL; VACUUM ANALYZE; just before running the test.

So is it just the planner/optimizer/etc. costs? Would a PREPARE in 7.3 help?

Best Regards,
Michael Paesold



pgsql-hackers by date:

Previous
From: "Michael Paesold"
Date:
Subject: Re: Bug in PL/pgSQL GET DIAGNOSTICS?
Next
From: Peter Eisentraut
Date:
Subject: Re: CVS checkout errors