Re: Performance advice

From: "Shridhar Daithankar" <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Performance advice
Date: 2003-06-25 09:58:58
Message-ID: 3EF9BFBA.17789.3CF4A70@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Rod Taylor 2003-06-25 11:06:22 Re: Performance advice
Previous Message Michael Mattox 2003-06-25 09:47:48 Re: Performance advice