couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <>
Subject Re: Are server-generated doc IDs better?
Date Thu, 30 Jun 2011 19:24:36 GMT
You can fully randomized uuids by changing from 'sequential' to
'random' but, yes, the shared prefix is a compromise between random
uuids and values that play nicely with a b+tree.


On 30 June 2011 20:04, Jens Alfke <> wrote:
> On Jun 30, 2011, at 12:35 AM, Benoit Chesneau wrote:
>> Other way is to get a bunch of uuids from couch and using them in your
>> PUT, so you don't have to generate yourself uuids. (and you have best
>> of both world).
> Yes, but it’s much simpler (and faster) to call CFUUIDCreate() rather than write all
the code to manage a pool of available IDs, call the server on demand to fetch more, block
if necessary until the server replies, handle HTTP errors…
> On Jun 29, 2011, at 6:08 PM, Dale Harvey wrote:
>> CouchDB generates uuid's that attempts to minimise the amount of rebalancing
>> that needs to happen on insert
> That’s funny — I had noticed yesterday that the doc IDs have long prefixes in common,
and felt that this was possibly bad for performance because it slows down string comparisons
(more bytes to scan before finding a difference.) But of course that’s trivial compared
to the overhead you refer to of fetching more b-tree pages from disk on insert. This must
indicate that I come from a hash-table background, not a b-tree one :)
> —Jens

View raw message