Re: Counting the number of items in a bucket

2011-11-24 Thread francisco treacy
Actually, I think it's less efficient (more data sent over the wire) – but happens to be faster. The client is simply buffering key lengths from a chunked response, which happens to be way faster than supplying keys=true. I haven't looked at how this is implemented in Riak. 2011/11/24 Soren Hanse

Re: Counting the number of items in a bucket

2011-11-24 Thread Soren Hansen
2011/11/24 Stephen Bennett : > This is an extremely efficient way of counting the size of the bucket. Perhaps I missed it. What does it do that makes it extremely efficient? Are you perhaps just speaking in terms of lines of code? Or does the riak-js library do fancy things in the .count() method?

Re: Counting the number of items in a bucket

2011-11-24 Thread Stephen Bennett
Thanks. This is an extremely efficient way of counting the size of the bucket. On 22 November 2011 15:23, francisco treacy wrote: > I would probably stream keys to the client and count them there (it's the > most efficient method I can think of) > > If you have node.js installed, do this: > > np

Re: Counting the number of items in a bucket

2011-11-22 Thread francisco treacy
I would probably stream keys to the client and count them there (it's the most efficient method I can think of) If you have node.js installed, do this: npm install riak-js@latest node -e "require('riak-js').getClient({ port: 8098 }).count('bucket');" 2011/11/21 Stephen Bennett > I have a buck

Re: Counting the number of items in a bucket

2011-11-22 Thread Fyodor Yarochkin
This depends on what riak version (1.x.x) and backend storage you're using 2i indexes are supported by eleveldb ( bitcask is default), but you can just specify inputs w/ key filters or just a bucket name, i.e "inputs": "yourbucket", or "inputs":{ "bucket":"yourbucket", "key_filters":[["e

Re: Counting the number of items in a bucket

2011-11-22 Thread Stephen Bennett
Thanks for that. I've tried to run this across my cluster but it just returns an error message. Do I need to include a key filter as well? An error occurred parsing the "inputs" field. Key filter expression missing filter list. On 22 November 2011 08:42, Fyodor Yarochkin wrote: > You can t

Re: Counting the number of items in a bucket

2011-11-22 Thread Fyodor Yarochkin
You can try to limit input by particular subset of ranges, if that helps. Here's my count m-r snippet: { "inputs":{ "bucket":"data", "index":"numero_int", "start":0, "end":1212 }, "query":[ {"map": {"language":"erlang","module":"riak_kv_mapreduce","functio