On Thu, 22 Apr 2010 13:12:16 +0200, Johan De Meersman <vegiv...@tuxera.be>

wrote:

> Kudos for managing to drag up such an obscure piece of functionality :-)

I

> can see where it would be useful, though.

> 

> As to your question, though: given that that page indicates that it will

> reuse deleted sequence numbers, I think your best bet would be select

@id

> :=

> count(*)+1 from table where cluster='clusterA' AND file='fileA' ; -

should

> be slightly faster than a max(), I think. That in a trigger on your

table

> should emulate the behaviour pretty closely.



Wouldn't that strategy cause problems if one or more rows have been

deleted in the meantime? (i.e. sequence numbers 1-4 have been created, row

2 has been deleted - new sequence number would be 4).



/ Carsten



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to