listen/notify vs. sequence-model

From: pilsl(at)goldfisch(dot)at
To: pgsql-general(at)postgresql(dot)org
Subject: listen/notify vs. sequence-model
Date: 2003-04-07 15:36:05
Message-ID: 20030407153604.GA10802@goldfisch.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

for a caching-application I need to implement an indicator if my table
has been changed.

I will create three rules (insert, update, delete) and then imho there
are two ways to continue:

I could simply send notifies on changes and my application listen to
the notify or I could increment a sequence and the application queries
and memorize the value of the sequence.

The solution with the sequence would have the big advantage that the
application must not keep the db-handle open all the time. (the
solution would work with cgi also and not only with mod_perl in my
case)

My question is, if the sequence-model has very poor performance
compared to the listen/notify-modell.

I need three rules in both models. In the first case I need to send
and listen a notify.
In the second case I need to update and query a sequence.

thnx,
peter

ps: are rules executed when the current transaction is closed or
immediately after the corresponding statement ?

--
mag. peter pilsl
IT-Consulting
tel: +43-699-1-3574035
fax: +43-699-4-3574035
pilsl(at)goldfisch(dot)at
http://www.goldfisch.at

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-07 15:37:11 Re: possible time change issue - known problem?
Previous Message Dan Langille 2003-04-07 15:26:13 Re: possible time change issue - known problem?