incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Damien Katz <dam...@apache.org>
Subject Re: Why sequential document ids? [was: Re: What's the speed(performance) of couchdb?]
Date Mon, 02 Mar 2009 18:29:35 GMT

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.

-Damien

Mime
View raw message