Michael Segel wrote:
Presumably he column would be indexed if you're doing operations like
max() on it anyway, so efficiency isn't the problem.  I suspect the
problem would be what to do when two users tried to insert rows at
around the same time.  The second would fail to commit the transaction
and have to try again.

Daniel
No.
First, you're still returning a value from the sequence that will cause an exception. So you have overhead. Also you'd have a lot harder time trying to manage the inserts. Also, you have to consider that its cheaper to get a value from memory than it is to apply the max() function on a value from the index.

Ah. I was making the assumption that the indexes were implemented "properly." For instance, an index should keep a certain amount in memory in order to have a reasonable chance of running quickly. So the max and min should already be in-memory.

I take it that Derby doesn't do this?

Daniel


--
Daniel Noll

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://www.nuix.com.au/                        Fax: +61 2 9212 6902

This message is intended only for the named recipient. If you are not
the intended recipient you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
message or attachment is strictly prohibited.

Reply via email to