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