db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amir Michail" <amich...@gmail.com>
Subject Re: Most efficient way to get max row id?
Date Tue, 21 Oct 2008 18:53:13 GMT
On Tue, Oct 21, 2008 at 2:32 PM, Andrew McIntyre <mcintyre.a@gmail.com> wrote:
> On Sun, Oct 19, 2008 at 1:52 PM, Amir Michail <amichail@gmail.com> wrote:
>> Hi,
>>
>> I was wondering what is the most efficient way to get the max
>> automatically generated row id.
>>
>> select max(...) is slow.
>
> If this is an identity column, perhaps IDENTITY_VAL_LOCAL() suits your needs?
>
> http://db.apache.org/derby/docs/10.4/ref/rrefidentityvallocal.html
>
> andrew
>

I ended up storing the max id in another table (which I get
efficiently via IDENTITY_VAL_LOCAL() ).

Amir


-- 
http://chatbotgame.com
http://numbrosia.com
http://twitter.com/amichail

Mime
View raw message