Re: Benchmark shows very slow bulk delete

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Thom Brown" <thombrown(at)gmail(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Benchmark shows very slow bulk delete
Date: 2010-01-27 14:54:04
Message-ID: 4B5FFF2E020000250002EC78@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Thom Brown <thombrown(at)gmail(dot)com> wrote:

> Had a quick look at a benchmark someone put together of MySQL vs
> PostgreSQL, and while PostgreSQL is generally faster, I noticed
> the bulk delete was very slow:
> http://www.randombugs.com/linux/mysql-postgresql-benchmarks.html
>
> Is this normal?

It is if you don't have an index on the table which has a foreign
key defined which references the table in which you're doing
deletes. The author of the benchmark apparently didn't realize that
MySQL automatically adds such an index to the dependent table, while
PostgreSQL leaves it to you to decide whether to add such an index.
For "insert-only" tables, it isn't always worth the cost of
maintaining it.

Also, I see that the database was small enough to be fully cached,
yet the costs weren't adjusted to the recommended values for such an
environment, so PostgreSQL should *really* have beaten MySQL by more
than it did.

-Kevin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Steben 2010-01-27 15:33:45 test send (recommended by Dave Page)
Previous Message Matthew Wakeling 2010-01-27 14:49:06 Re: Benchmark shows very slow bulk delete