X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id C17AD30FBD1 for ; Wed, 25 Jun 2003 09:59:53 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 09877-07 for ; Wed, 25 Jun 2003 06:59:43 -0300 (ADT) Received: from www.pspl.co.in (www.pspl.co.in [202.54.11.65]) by svr1.postgresql.org (Postfix) with ESMTP id 1C52730FB73 for ; Wed, 25 Jun 2003 06:59:41 -0300 (ADT) Received: (from root@localhost) by www.pspl.co.in (8.11.6/8.11.6) id h5P9xf908514 for ; Wed, 25 Jun 2003 15:29:41 +0530 Received: from daithan (daithan.intranet.pspl.co.in [192.168.7.161]) by www.pspl.co.in (8.11.6/8.11.0) with ESMTP id h5P9xeG08509 for ; Wed, 25 Jun 2003 15:29:40 +0530 From: "Shridhar Daithankar" To: Date: Wed, 25 Jun 2003 15:28:58 +0530 MIME-Version: 1.0 Subject: Re: Performance advice Reply-To: shridhar_daithankar@persistent.co.in Message-ID: <3EF9BFBA.17789.3CF4A70@localhost> In-reply-to: References: X-mailer: Pegasus Mail for Windows (v4.02) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body X-Archive-Number: 200306/151 X-Sequence-Number: 2235 On 25 Jun 2003 at 11:47, Michael Mattox wrote: > I'm using Java Data Objects (JDO) which is an O/R mapper. It generated the > schema from my object model by default it used a table for a sequence. I > just got finished configuring it to use a real postgres sequence. With the > way they have it designed, it opens and closes a connection each time it > retrieves a sequence. Would I get a performance increase if I modify their > code to retrieve multiple sequence numbers in one connection? For example I > could have it grab 50 at a time, which would replace 50 connections with 1. You need to use sequence functions like setval, curval, nextval. May be you can write your own wrapper function to "grab" as many sequence values as you want but it would be good if you design/maintain locking around it as appropriate. See http://developer.postgresql.org/docs/postgres/sql-createsequence.html http://developer.postgresql.org/docs/postgres/functions-sequence.html HTH Bye Shridhar -- Velilind's Laws of Experimentation: (1) If reproducibility may be a problem, conduct the test only once. (2) If a straight line fit is required, obtain only two data points.