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

From David Wilson
Subject Re: table as log (multiple writers and readers)
Date
Msg-id e7f9235d0804211705j626af5eco35ce861c8cba5d6@mail.gmail.com
Whole thread Raw
In response to Re: table as log (multiple writers and readers)  (Joris Dobbelsteen <joris@familiedobbelsteen.nl>)
Responses Re: table as log (multiple writers and readers)  (Joris Dobbelsteen <joris@familiedobbelsteen.nl>)
List pgsql-general
On Mon, Apr 21, 2008 at 7:55 PM, Joris Dobbelsteen
<joris@familiedobbelsteen.nl> wrote:
>
>  If you want to clean up the the staging table I have some concerns about
> the advisory lock. I think you mean exclusive table lock.

Either works, really. An advisory lock is really just a lock over
which you have control of the meaning, as long as you're using it in
the appropriate places. Also, an advisory lock on just the processes
doing staging-to-log moves would allow writes into the staging table
to continue concurrently with the staging-to-log transaction (whereas
an exclusive lock would unnecessarily prevent them).

Also, while Vance appears to have chosen to have a dedicated
staging-to-log process, even that isn't necessary- each reader can
simply do the lock/clear staging/unlock before any attempt to read-
unless you're polling that log table at truly crazy rates, the
overhead should be negligible and will ensure that the staging table
is simply cleared out "whenever necessary" while removing the
complexity of a separate process.


--
- David T. Wilson
david.t.wilson@gmail.com

pgsql-general by date:

Previous
From: Joris Dobbelsteen
Date:
Subject: Re: table as log (multiple writers and readers)
Next
From: Christophe
Date:
Subject: Schema migration tools?