Re: performance of insert/delete/update

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: josh(at)agliodbs(dot)com
Cc: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>, PgSQL Performance ML <pgsql-performance(at)postgresql(dot)org>
Subject: Re: performance of insert/delete/update
Date: 2002-11-23 20:41:57
Message-ID: 19419.1038084117@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

Josh Berkus <josh(at)agliodbs(dot)com> writes:
>> On my machine I see a sizable difference (more than 2x) in the rate at
>> which simple INSERT statements are processed as separate transactions
>> and as large batches --- if I have fsync on. With fsync off, nearly no
>> difference.

> I'm using fdatasych, which *does* perform faster than fsych on my system.
> Could this make the difference?

No; you still have to write the data and wait for the disk to spin.
(FWIW, PG defaults to wal_sync_method = open_datasync on my system,
and that's what I used in checking the speed just now. So I wasn't
actually executing any fsync() calls either.)

On lots of PC hardware, the disks are configured to lie and report write
complete as soon as they've accepted the data into their internal
buffers. If you see very little difference between fsync on and fsync
off, or if you are able to benchmark transaction rates in excess of your
disk's RPM, you should suspect that your disk drive is lying to you.

As an example: in testing INSERT speed on my old HP box just now,
I got measured rates of about 16000 inserts/minute with fsync off, and
5700/min with fsync on (for 1 INSERT per transaction). Knowing that my
disk drive is 6000 RPM, the latter number is credible. On my PC I get
numbers way higher than the disk rotation rate :-(

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2002-11-23 20:48:14 Re: performance of insert/delete/update
Previous Message Josh Berkus 2002-11-23 20:31:50 Re: performance of insert/delete/update

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Berkus 2002-11-23 20:48:14 Re: performance of insert/delete/update
Previous Message Josh Berkus 2002-11-23 20:31:50 Re: performance of insert/delete/update