Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 5D8429FB5B4 for ; Mon, 23 Apr 2007 20:12:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 99818-06 for ; Mon, 23 Apr 2007 20:12:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 9A8D29FB526 for ; Mon, 23 Apr 2007 20:12:18 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from outG.internet-mail-service.net (outG.internet-mail-service.net [216.240.47.230]) by svr4.postgresql.org (Postfix) with ESMTP id B37495AF8B6 for ; Mon, 23 Apr 2007 23:12:17 +0000 (GMT) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.32) with ESMTP; Mon, 23 Apr 2007 15:39:47 -0700 Received: from [192.168.1.109] (adsl-71-135-160-185.dsl.pltn13.pacbell.net [71.135.160.185]) by idiom.com (Postfix) with ESMTP id 556F3125B1C for ; Mon, 23 Apr 2007 16:12:14 -0700 (PDT) Message-ID: <462D3D4D.6090308@obviously.com> Date: Mon, 23 Apr 2007 16:12:13 -0700 From: Bryce Nesbitt User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20061107 SUSE/1.1.1-0.1 SeaMonkey/1.1.1 MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Large journal as psql table. Good idea? Triggering. Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/218 X-Sequence-Number: 28218 Dear Postgres folks; I'm considering using a postgres table for something that could be done with a flat file. Is this a good idea? I have events on a machine "A", which need to be sent by an SMS/Cell Phone modem that's on a totally different machine "B". Potentially this is a job for a flat file FIFO. But I'm thinking that maybe it's a job for a database table. Each new row would be written with a status (10="new"). And that the modem process would poll for new rows. Problem is there will be lots of rows, but only a trivial few will be "new". The huge index file and the polling seem like a drag on the database, unless there is a way to optimize. On the good side, this scheme handles building the FIFO and the IPC (interprocess communication). Is is a good approach, using postgres as a glorified FIFO? Should the DB on machine "A" or "B"? Is there a way to trigger or lower the polling overhead (in this application the delay is user visible). The volume is low (a few messages a minute tops). Bryce