Using condition variables to wait for checkpoints - Mailing list pgsql-hackers

From Thomas Munro
Subject Using condition variables to wait for checkpoints
Date
Msg-id CA+hUKGLY7sDe+bg1K=bnEzOofGoo4bJHYh9+cDCXJepb6DQmLw@mail.gmail.com
Whole thread Raw
Responses Re: Using condition variables to wait for checkpoints
List pgsql-hackers
Hello hackers,

A user complained about CREATE DATABASE taking > 200ms even with fsync
set to off.  Andres pointed out that that'd be the clunky poll/sleep
loops in checkpointer.c.

Here's a draft patch to use condition variables instead.

Unpatched:

postgres=# checkpoint;
CHECKPOINT
Time: 101.848 ms

Patched:

postgres=# checkpoint;
CHECKPOINT
Time: 1.851 ms

-- 
Thomas Munro
https://enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: performance issue in remove_from_unowned_list()
Next
From: Andres Freund
Date:
Subject: Re: Using condition variables to wait for checkpoints