On Mon, Oct 20, 2008 at 12:15 AM, Amir Michail <
amichail@...> wrote:
> On Sun, Oct 19, 2008 at 11:25 PM, Kai Ponte <
kai@...> 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@...> 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
--
http://chatbotgame.comhttp://numbrosia.comhttp://twitter.com/amichail