>    would at least reach thousands, so fetching all keys is quite
demanding

My suggestion may well be the wrong path to take, but I'd like to point out
that fetching thousands of keys is nothing.  Getting 16 kbytes of data
takes a few ms.  And  internally couch has all the keys already sorted and
ready to dump when you ask for it.  It's not like this 16K is going across
the wire to the client.

I use this kind of query all the time.  However, using a reduce would be
much better.  You could keep a list of the ten lowest values found so far.
 That is a finite amount of data and legal for a reduce.

Reply via email to