From: Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
To: pgsql-performance@postgresql.org
Subject: Re: Performance advice
Date: Wed, 25 Jun 2003 15:28:58 +0530
Message-ID: <3EF9BFBA.17789.3CF4A70@localhost> (raw)
In-Reply-To: <CJEBLDCHAADCLAGIGCOOCEKBCKAA.michael.mattox@verideon.com>
References: <k3hifvg6on4qckbo5qjktptckf5tvfghp6@4ax.com>
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.htmlhttp://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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: shridhar_daithankar@persistent.co.in
Subject: Re: Performance advice
In-Reply-To: <3EF9BFBA.17789.3CF4A70@localhost>
References: <k3hifvg6on4qckbo5qjktptckf5tvfghp6@4ax.com> <3EF9BFBA.17789.3CF4A70@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox