Re: PostgreSQL: YMMV? - Mailing list pgsql-general

From Peter Eisentraut
Subject Re: PostgreSQL: YMMV?
Date
Msg-id Pine.LNX.4.30.0106252136070.724-100000@peter.localdomain
Whole thread Raw
In response to PostgreSQL: YMMV?  (Jan Ploski <jpljpl@gmx.de>)
List pgsql-general
Jan Ploski writes:

> I did a little private MySQL (3.23.28) vs PostgreSQL (7.1r1) benchmark.
> I heard about MySQL's problems with locking/concurrency. So I expected
> that my code would highlight them. It did not. It revealed a problem (?)
> with PostgreSQL, however. Here is how it all went:
>
> The code is written in Java. 10 writer threads and 20 reader threads
> are started. Each thread inserts or selects 500 rows in a loop from
> this table (selects are done on random id's, no indices involved):

Did they all use the same Connection object?

>     CREATE TABLE bench (
>        id          int4            DEFAULT nextval('bench_id_seq'),
>        body        text            NOT NULL,
>        subject     varchar(255)    NOT NULL,
>        fld1        varchar(80)     NOT NULL,
>        fld2        varchar(80)     NOT NULL,
>        fld3        varchar(80)     NOT NULL,
>        fld4        varchar(80)     NOT NULL,
>        fld5        varchar(80)     NULL,
>        fld6        varchar(80)     NULL,
>        fld7        int2            NOT NULL,
>        fld8        int2            NULL,
>        PRIMARY KEY(id) )

That sure looks like an index right there.  I don't know if MySQL creates
an index for primary keys, but it might explain a performance drop for
INSERTs.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


pgsql-general by date:

Previous
From: Tomas Berndtsson
Date:
Subject: Re: timestamp to int
Next
From: "Thalis A. Kalfigopoulos"
Date:
Subject: Re: Large objects in web applications