Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6627397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:00:32+00:00 2026-05-25T22:00:32+00:00

According to Riak’s docs (using Python bindings), get_keys() is extremely expensive and not suitable

  • 0

According to Riak’s docs (using Python bindings), get_keys() is extremely expensive and not suitable for production. My question is whether a very simple map query is suitable. For instance, using a map stage only with the function:

function(v) { return [v.key]; }

is this going to perform better than get_keys()? why wouldn’t Riak ship with this implementation instead of the current version of get_keys()? Is there a better way I should be listing keys for a bucket?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:00:33+00:00Added an answer on May 25, 2026 at 10:00 pm

    The get_keys() function calls list_keys in the back end and is considered to be an expensive operation because it performs a full scan of the key space. Depending on your Riak back end, this could also involve a full scan of the data as stored on disk (InnoStore springs to mind). The default storage back end (Bitcask) stores all of your keys in memory, so performance shouldn’t be as much of a problem.

    The other reason list_keys was considered expensive is because it was formerly a blocking operation as it involved what the Basho developers refer to as a ‘fold’ over all of the keys. list_keys now uses a snapshot of the bucket (instead of reading the live key space) and this makes it a lighter weight operation as well.

    This is made easier with an upgrade to Riak 1.0. If you’re using the LevelDB back end, you can enable secondary indexes on a bucket and use the $key index (automatically provided by Riak) to get you a list of all keys in a bucket.

    As for why Riak doesn’t ship with a better implementation of something like this: ask what the functionality is for. In an RDBMS, getting all primary keys of a table involves a full table scan. In Riak, getting all keys from a bucket requires scanning all data in every node and then shipping the key names back to the originating node, combining that data, and then sending it to the calling client. Because of Riak’s distributed, unordered, state this operation is expensive no matter how you slice it. There are, as I outlined above, ways to make it better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to the answers to this question, I cannot embed a file version in
According to Five Simple Database Design Errors You Should Avoid by Anith Sen, using
According to http://www.rebol.com/docs/core23/rebolcore-15.html You can use change/part to parse and replace but that doesn't
According to the PHP docs, one can initialize properties in classes with the following
According to my last post in here one of friends suggested this code: using
According documentation: System.Array.Sort<T> - sorts the elements in an entire System.Array using the System.IComparable
According to the documentation i would like to overwrite predefined formats using this settings:
According to docs numpy's default behaviour is to index arrays first by rows then
According to the MSDN docs the ReceiveBufferSize defaults to 8192. I checked and it's
According to this discussion , the iphone agreement says that it doesn't allow loading

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.