On Thu, 5 Sep 2002 fpaul@netcourrier.com wrote:
> I launch these programs on my computer : Linux Debian with MySQL 3.23.51 and PostgreSQL 7.2.1 (installation by
defaultwith '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.