Re: PostgreSQL vs MySQL : strange results on insertion

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: <fpaul(at)netcourrier(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: PostgreSQL vs MySQL : strange results on insertion
Date: 2002-09-05 17:04:04
Message-ID: Pine.LNX.4.33.0209051102160.16283-100000@css120.ihs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 5 Sep 2002 fpaul(at)netcourrier(dot)com wrote:

> I launch these programs on my computer : Linux Debian with MySQL 3.23.51 and PostgreSQL 7.2.1 (installation by default with 'apt-get install').
> Time to realize 10000 insertions with MySQL:
> $ time ./test__mysql
>
> real 0m1.500s
> user 0m0.150s
> sys 0m0.090s
> (between 1 and 2 seconds)
>
> Time to realize 10000 insertions with PostgreSQL:
> $time ./test_postgresql
>
> real 0m28.568s
> user 0m0.390s
> sys 0m0.270s
> (between 28 and 30 seconds !!!.... )
>
> Very strange, isn't it ? Is there something in PostgreSQL's C API that I didn't understand ? Subtleties during the configuration ? I do not want to believe that PostgreSQL is 15 times slower than MySQL !
> Thank you for any comment, remark and correction!

Not really all that strange. Again, this is a side effect of using a
transactionally oriented database. Try adding a begin; and end; pair
around your inserts in postgresql and see if it runs faster.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2002-09-05 17:09:39 Re: show ?
Previous Message scott.marlowe 2002-09-05 16:51:59 Re: uninstall postgresql