Re: Performance advice - Mailing list pgsql-performance

From Shridhar Daithankar
Subject Re: Performance advice
Date
Msg-id 3EF9BFBA.17789.3CF4A70@localhost
Whole thread Raw
In response to Re: Performance advice  ("Michael Mattox" <michael.mattox@verideon.com>)
List pgsql-performance
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.


pgsql-performance by date:

Previous
From: "Michael Mattox"
Date:
Subject: Re: Performance advice
Next
From: Rod Taylor
Date:
Subject: Re: Performance advice