X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6D8EADB2B0 for ; Fri, 28 Oct 2005 19:13:32 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66342-08 for ; Fri, 28 Oct 2005 22:13:29 +0000 (GMT) Received: from viefep18-int.chello.at (viefep18-int.chello.at [213.46.255.21]) by svr1.postgresql.org (Postfix) with ESMTP id 3AD01DB2AE for ; Fri, 28 Oct 2005 19:13:29 -0300 (ADT) Received: from OTTO ([213.222.172.216]) by viefep18-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with SMTP id <20051028221326.SZAW27617.viefep18-int.chello.at@OTTO>; Sat, 29 Oct 2005 00:13:26 +0200 Message-ID: <01cb01c5dc0c$cce42830$8400a8c0@OTTO> From: =?iso-8859-1?Q?Havasv=F6lgyi_Ott=F3?= To: "Rodrigo Madera" , References: <3cf983d0510281439s648fac45vbd7af544eeca4fc3@mail.gmail.com> Subject: Re: Best way to check for new data. Date: Sat, 29 Oct 2005 00:13:18 +0200 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_01C8_01C5DC1D.904488A0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=-0.078 required=5 tests=[AWL=-0.079, HTML_MESSAGE=0.001] X-Spam-Score: -0.078 X-Spam-Level: X-Archive-Number: 200510/444 X-Sequence-Number: 15212 This is a multi-part message in MIME format. ------=_NextPart_000_01C8_01C5DC1D.904488A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Rodrigo, You could use LISTEN + NOTIFY with triggers. In after_insert_statement trigger you could notify a listener, the = client could query it immediately. Best Regards, Otto ----- Original Message -----=20 From: Rodrigo Madera=20 To: pgsql-performance@postgresql.org=20 Sent: Friday, October 28, 2005 11:39 PM Subject: [PERFORM] Best way to check for new data. I have a table that holds entries as in a ficticious table Log(id = integer, msg text). Lets say then that I have the program log_tail that has as it=B4s sole = purpose to print newly added data elements. What is the best solution in terms of performace? Thank you for your time, Rodrigo ------=_NextPart_000_01C8_01C5DC1D.904488A0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Rodrigo,
 
You could use LISTEN + NOTIFY with=20 triggers.
In after_insert_statement trigger you = could notify=20 a listener, the client could query it immediately.
 
Best Regards,
Otto
 
----- Original Message -----
From:=20 Rodrigo Madera
To: pgsql-performance@postgr= esql.org=20
Sent: Friday, October 28, 2005 = 11:39=20 PM
Subject: [PERFORM] Best way to = check for=20 new data.

I have a table that holds entries as in a ficticious table Log(id = integer, msg text).
 
Lets say then that I have the program log_tail that has as it=B4s = sole=20 purpose to print newly added data elements.
 
What is the best solution in terms of performace?
 
Thank you for your time,
Rodrigo
 
------=_NextPart_000_01C8_01C5DC1D.904488A0--