Re: speed on Postgresql compared to Mysql

From: Joel Burton <jburton(at)scw(dot)org>
To: Livio Righetti <livio(dot)righetti(at)mcnet(dot)ch>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: speed on Postgresql compared to Mysql
Date: 2001-04-08 09:30:03
Message-ID: Pine.LNX.4.21.0104080528220.19671-100000@olympus.scw.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 3 Apr 2001, Livio Righetti wrote:

> Hi,
>
> Talking about insert, I know Mysql is fast than Postgresql.
>
> I've made the following test :
>
> 40'000 insert (accouting context) using Perl and dbd :
>
> Postgresql :
> text : 4 min 53 s
> varchar : 4 min 49 s
> char : 4 min 49 s
>
> Mysql :
> text : 0 min 29 s
> varchar : 0 min 29 s
> char : 0 min 29 s
>
> So we can see Mysql is about 10 times fast.
>
> Also we used Postgresql for Radius (authentication) et we have to make 3
> vacuum per day otherwise the first server is overload and the user go to the
> backup server.
>
> Is it normal or my Postgresql is not well configured ?

Err, yes.

Did you just do 40,000 inserts in a row, one after another? Realistic
speed tests often have many requests coming in together, to simulate
application- and web-usage.

In addition, did you wrap this in a transaction? Otherwise, you're
performing one transaction for *every single* insert, which is much slower
than in a a transaction.

(Generally speaking, if you want to just add 40,000 rows to a table, I'd
use COPY, not INSERT ;-) )

HTH,

--
Joel Burton <jburton(at)scw(dot)org>
Director of Information Systems, Support Center of Washington

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joel Burton 2001-04-08 09:44:28 Re: information on users
Previous Message Joel Burton 2001-04-08 09:26:33 Re: converting from php3 to php4