Re: table as log (multiple writers and readers) - Mailing list pgsql-general

From Andrew Sullivan
Subject Re: table as log (multiple writers and readers)
Date
Msg-id 20080417045100.GA1719@crankycanuck.ca
Whole thread Raw
In response to Re: table as log (multiple writers and readers)  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: table as log (multiple writers and readers)
List pgsql-general
On Thu, Apr 17, 2008 at 12:44:51PM +0800, Craig Ringer wrote:
> It won't work with multiple concurrent writers. There is no guarantee
> that an INSERT with a timestamp older than the one you just saw isn't
> waiting to commit.

This is pretty unlikely -- I won't say impossible, because I'm sure there's
some kernel-level race condition -- if you use the clock time approach and
SERIALIZABLE mode.  You could add a trigger that checks for other timestamps
< yours, I suppose.  Of course, that's pretty heavyweight, too.  How much is
the absolute serialization worth to you in performance?

The only other thing I can suggest is what someone else did: commit them
with wallclock timestamps, and then have a different thread wake up every
_n_ seconds and put the records into the proper table in timestamp order.

A

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: table as log (multiple writers and readers)
Next
From: Andrew Sullivan
Date:
Subject: Re: table as log (multiple writers and readers)