X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id DF68211F6635 for ; Wed, 12 Apr 2006 04:18:32 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.12 X-Spam-Level: X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id ftPgQOfxGU47 for ; Wed, 12 Apr 2006 04:18:28 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from peufeu.com (boutiquenumerique.com [82.67.9.10]) by postgresql.org (Postfix) with ESMTP id AAF0611F65F1 for ; Wed, 12 Apr 2006 04:18:29 -0300 (ADT) Received: (qmail 27750 invoked from network); 12 Apr 2006 09:19:21 +0200 Received: from boutiquenumerique.com (HELO apollo13) (82.67.9.10) by boutiquenumerique.com with SMTP; 12 Apr 2006 09:19:21 +0200 Date: Wed, 12 Apr 2006 09:19:18 +0200 To: "Jim C. Nasby" , "C Storm" Subject: Re: pgmemcache Cc: pgsql-performance@postgresql.org References: <1144135482.063425.33380@z34g2000cwc.googlegroups.com> <20060411225515.GZ49405@pervasive.com> From: PFC Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: In-Reply-To: <20060411225515.GZ49405@pervasive.com> User-Agent: Opera M2/8.51 (Linux, build 1462) X-Archive-Number: 200604/257 X-Sequence-Number: 18341 It would be nice to have ON COMMIT triggers for this use. However you can emulate ON COMMIT triggers with a modification of the memcache update process : - A standard trigger sends the data to update to memcache - The trigger also sends the PID - Instead of being used immediately, this data is kept in a buffer - Notify is issued On commit : - postgres sends the NOTIFY signal - the memcache updater reads the NOTIFY (which embeds the PID I believe) ; it finds the buffered data sent above and uses it to update memcached On rollback : - Interesting problem ;))) OK, it's a kludge. When can we get ON COMMIT triggers ? > On Tue, Apr 04, 2006 at 12:24:42AM -0700, C Storm wrote: >> I was wondering if anyone on the list has a successful installation of >> pgmemcache running >> that uses LISTEN/NOTIFY to signal a successfully completed transaction, >> i.e., to get around the fact >> that TRIGGERS are transaction unaware. Or perhaps any other >> information regarding a successful >> deployment of pgmemcache. > > The problem with attempting that is that you'd have a window between > transaction commit and when the cache was invalidated. If that's > acceptable then it shouldn't be too difficult to set something up using > LISTEN/NOTIFY like you describe.