db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Suavi Ali Demir <dem...@yahoo.com>
Subject Re: Most efficient way to get max row id?
Date Mon, 20 Oct 2008 04:57:39 GMT
You should have an index.


--- On Sun, 10/19/08, Amir Michail <amichail@gmail.com> wrote:

> From: Amir Michail <amichail@gmail.com>
> Subject: Re: Most efficient way to get max row id?
> To: "Derby Discussion" <derby-user@db.apache.org>
> Date: Sunday, October 19, 2008, 9:18 PM
> On Mon, Oct 20, 2008 at 12:15 AM, Amir Michail
> <amichail@gmail.com> wrote:
> > On Sun, Oct 19, 2008 at 11:25 PM, Kai Ponte
> <kai@perfectreign.com> wrote:
> >> On Sunday 19 October 2008 02:04:29 pm Amir Michail
> wrote:
> >>> On Sun, Oct 19, 2008 at 5:00 PM, Peter
> Ondruška
> >>>
> >>> <peter.ondruska@gmail.com> wrote:
> >>> > You want to use identity: Defining an
> identity column
> >>>
> >>> Yes, but how do you get the max row id
> efficiently without adding another
> >>> row?
> >>
> >> In the particular table, how many rows are you
> referring to? A few thousand? A
> >> few million?  A hundred million?
> >>
> >> Do you have an index on the identity column? 
> What's your datatype?
> >
> > ~60,000 rows
> 
> But there's also a where in the query, so the number of
> rows
> considered by max will vary.  A slow case involves ~ 16000
> rows.
> 
> Amir
> 
> >
> > So if I put an index on the identity column, max will
> be fast?
> >
> > Amir
> >
> >>
> >> --
> >> kai
> >> www.filesite.org || www.perfectreign.com
> >>
> >>
> >> Clean out a corner of your mind and creativity
> will instantly fill it. - Dee
> >> Hock
> >>
> >
> >
> >
> > --
> > http://chatbotgame.com
> > http://numbrosia.com
> > http://twitter.com/amichail
> >
> 
> 
> 
> -- 
> http://chatbotgame.com
> http://numbrosia.com
> http://twitter.com/amichail

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message