Re: Index optimization ? - Mailing list pgsql-general

From Jim C. Nasby
Subject Re: Index optimization ?
Date
Msg-id 20050116011502.GR67721@decibel.org
Whole thread Raw
In response to Re: Index optimization ?  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List pgsql-general
On Sat, Jan 15, 2005 at 06:34:11PM -0300, Alvaro Herrera wrote:
> On Sat, Jan 15, 2005 at 03:11:22PM -0600, Jim C. Nasby wrote:
>
> > Would it make sense to have a version of currval that will only return
> > one value in a statement/transaction? So the first time it's called it
> > remembers what currval for that sequence is and always returns the same
> > value?
>
> What would nextval() do in that case?  Return the nextval on the first
> call, and act like currval() from then until the end of the transaction?

I'm not sure which would be best. It could either do what you suggest,
or it could operate as normal, or it could possibly throw an error if
run a second time.
--
Jim C. Nasby, Database Consultant               decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: PQexecParams and CURSOR
Next
From: Michael Fuhr
Date:
Subject: Re: Is it possible to measure IO costs of a query in postgreSQL?