Re: Postgresql INSERT speed (how to improve performance)? - Mailing list pgsql-general

From Tony Caduto
Subject Re: Postgresql INSERT speed (how to improve performance)?
Date
Msg-id 46C11ADD.9020104@amsoftwaredesign.com
Whole thread Raw
In response to Postgresql INSERT speed (how to improve performance)?  ("Lim Berger" <straightfwd007@gmail.com>)
List pgsql-general
Lim Berger wrote:
>
> INSERTing into MySQL takes 0.0001 seconds per insert query.
> INSERTing into PgSQL takes 0.871 seconds per (much smaller) insert query.
>
> What can I do to improve this performance? What could be going wrong
> to elicit such poor insertion performance from Postgresql?
>
> Thanks.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>


The first thing I would ask is what type of DB engine are you using
while doing the inserts on MySQL?
The reason MySQL is doing the inserts faster is it does not have
transaction support if you are using anything other than InnoDB.

With that said you can increase your insert performance by simply using
a transaction and committing every 1000 rows or so.

If you do this you will see a huge performance increase.

hope that helps.

Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of Lightning Admin for PostgreSQL and MySQL



pgsql-general by date:

Previous
From: Ow Mun Heng
Date:
Subject: Copy command and duplicate items (Support Replace?)
Next
From: "Andrej Ricnik-Bay"
Date:
Subject: Re: Postgresql INSERT speed (how to improve performance)?