Re: Performance advice

Поиск
Список
Период
Сортировка
От Shridhar Daithankar
Тема Re: Performance advice
Дата
Msg-id 3EF9BFBA.17789.3CF4A70@localhost
обсуждение исходный текст
Ответ на Re: Performance advice  ("Michael Mattox" <michael.mattox@verideon.com>)
Список 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 по дате отправления:

Предыдущее
От: "Michael Mattox"
Дата:
Сообщение: Re: Performance advice
Следующее
От: Rod Taylor
Дата:
Сообщение: Re: Performance advice