On 2 Mar 2009, at 19:29, Damien Katz wrote:


On Mar 2, 2009, at 1:22 PM, Jan Lehnardt wrote:


On 2 Mar 2009, at 19:17, Brian Candler wrote:

On Fri, Feb 27, 2009 at 10:11:12AM -0800, Chris Anderson wrote:
I wonder if there's a way to get roughly ascending uuids (v1-ish)
without the security issues that come from having the originating node
permanently inscribed on each document...

If doing bulk inserts: the client can ask for a uuid, take the top N bits,
and append its own M-bit sequence number to the end?

it can also get document-count UUIDs sort them and bulk insert docs
in that order. :)

That won't help because the insertions places in the btree are still evenly distributed, and besides CouchDB does that step itself.

A better way would be to grab a UUID and increment it by 1 for the id of each new document you are saving. You still don't get great caching behavior as you are still inserting into a random place in the btree, but it's much better than N random inserts.

right, I only read the first half of your earlier remark: "And they don't need to sort higher or lower than all the other ids, so long as they are clustered together. "

nevermind.

Cheers
Jan
--


Reply via email to