pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after - Mailing list pgsql-committers

From stark@postgresql.org (Greg Stark)
Subject pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after
Date
Msg-id 20100215005057.5AC8F7541C5@cvs.postgresql.org
Whole thread Raw
Responses Re: pgsql: Speed up CREATE DATABASE by deferring the fsyncs until after  (Andres Freund <andres@anarazel.de>)
List pgsql-committers
Log Message:
-----------
Speed up CREATE DATABASE by deferring the fsyncs until after copying
all the data and using posix_fadvise to nudge the OS into flushing it
earlier. This also hopefully makes CREATE DATABASE avoid spamming the
cache.

Tests show a big speedup on Linux at least on some filesystems.

Idea and patch from Andres Freund.

Modified Files:
--------------
    pgsql/src/backend/storage/file:
        fd.c (r1.153 -> r1.154)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/file/fd.c?r1=1.153&r2=1.154)
    pgsql/src/include/storage:
        fd.h (r1.66 -> r1.67)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/fd.h?r1=1.66&r2=1.67)
    pgsql/src/port:
        copydir.c (r1.25 -> r1.26)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/port/copydir.c?r1=1.25&r2=1.26)

pgsql-committers by date:

Previous
From: rhaas@postgresql.org (Robert Haas)
Date:
Subject: pgsql: Wrap calls to SearchSysCache and related functions using macros.
Next
From: itagaki@pgfoundry.org (User Itagaki)
Date:
Subject: reorg - pg_reorg: version 1.0.8.