On Saturday 12 December 2009 21:38:41 Andres Freund wrote:
> On Saturday 12 December 2009 21:36:27 Michael Clemmons wrote:
> > If ppl think its worth it I'll create a ticket
> Thanks, no need. I will post a patch tomorrow or so.
Well. It was a long day...
In this patch I delay the fsync done in copy_file and simply do a second pass
over the directory in copy_dir and fsync everything in that pass.
Including the directory - which was not done before and actually might be
necessary in some cases.
I added a posix_fadvise(..., FADV_DONTNEED) to make it more likely that the
copied file reaches storage before the fsync. Without the speed benefits were
quite a bit smaller and essentially random (which seems sensible).
This speeds up CREATE DATABASE from ~9 seconds to something around 0.8s on my
laptop. Still slower than with fsync off (~0.25) but quite a worthy
The benefits are obviously bigger if the template database includes anything
In response to
pgsql-performance by date
|Next:||From: Andres Freund||Date: 2009-12-28 22:59:43|
|Subject: Re: [HACKERS] Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb)|
|Previous:||From: Craig James||Date: 2009-12-28 18:37:12|
|Subject: Re: SATA drives performance|
pgsql-hackers by date
|Next:||From: Dimitri Fontaine||Date: 2009-12-28 22:55:42|
|Subject: Re: Admission Control Policy|
|Previous:||From: Tom Lane||Date: 2009-12-28 22:41:04|
|Subject: Stats for inheritance trees|