X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id DBB05475CE5 for ; Sat, 10 May 2003 14:31:31 -0400 (EDT) Received: from lakemtao04.cox.net (lakemtao04.cox.net [68.1.17.241]) by postgresql.org (Postfix) with ESMTP id 252C94758F1 for ; Sat, 10 May 2003 14:31:31 -0400 (EDT) Received: from [192.168.1.1] ([68.11.66.83]) by lakemtao04.cox.net (InterMail vM.5.01.04.05 201-253-122-122-105-20011231) with ESMTP id <20030510183132.PNSG13930.lakemtao04.cox.net@[192.168.1.1]> for ; Sat, 10 May 2003 14:31:32 -0400 Subject: Re: realtime data inserts From: Ron Johnson To: pgsql-general@postgresql.org In-Reply-To: <6754.1052582402@sss.pgh.pa.us> References: <6754.1052582402@sss.pgh.pa.us> Content-Type: text/plain Organization: Message-Id: <1052591490.26574.161.camel@haggis> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 10 May 2003 13:31:30 -0500 Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=-41.1 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, REPLY_WITH_QUOTES,SIGNATURE_LONG_DENSE,USER_AGENT_XIMIAN autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200305/328 X-Sequence-Number: 41983 On Sat, 2003-05-10 at 11:00, Tom Lane wrote: > "Adam Siegel" writes: > > I have realtime data flowing at a rate of 500, 512 byte packets per second. > > I want to log the info in a database table with two other columns, one for a > > timestamp and one for a name of the packet. The max rate I can achieve is > > 350 inserts per second on a sun blade 2000. The inserts are grouped in a > > transaction and I commit every 1200 records. > > Have you thought about using COPY? Generate a temporary file, and then system("COPY /tmp/foobar ...") ? -- +---------------------------------------------------------------+ | Ron Johnson, Jr. mailto:ron.l.johnson@cox.net | | Jefferson, LA USA http://members.cox.net/ron.l.johnson | | | | The purpose of the military isn't to pay your college tuition | | or give you a little extra income; it's to "kill people and | | break things". Surprisingly, not everyone understands that. | +---------------------------------------------------------------+