Just an idea, if you really want an auto-increment and not the suggestion using xdmp:random() you might consider a "small" document for this, or the properties document. Updating any part of a document will update the whole thing (I belive) so if you are updating just a version # in a huge document performance will be non-ideal. Wherease just updating the properties document should be faster.
Just a guess, you would want to try first to validate. ---------------------------------------- David A. Lee Senior Principal Software Engineer Epocrates, Inc. [email protected]<mailto:[email protected]> 812-482-5224 From: [email protected] [mailto:[email protected]] On Behalf Of Raghu Sent: Friday, December 16, 2011 10:06 AM To: General MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Auto increment id in an update xquery Thank you John! that is all i wanted to know On Dec 16, 2011 7:36 PM, "John Snelson" <[email protected]<mailto:[email protected]>> wrote: The method you have devised will work as you expect it to. It will also perform badly as it will lock out concurrent updates. You should consider using xdmp:random() to generate a 64 bit random number for your unique identifier. John On 16/12/11 13:55, Raghu wrote: > Hi All, > I need to auto increment an id (long int) base... -- John Snelson, Senior Engineer http://twitter.com/jpcs MarkLogic Corporation http://www.marklogic.com _______________________________________________ General mailing list [email protected]<mailto:[email protected]> http://developer.marklogic.com/mailman/listinfo/general
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
