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 7043637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:18:51+00:00 2026-05-28T02:18:51+00:00

I tried to create some users for my testing. I created users in a

  • 0

I tried to create some users for my testing. I created users in a loop from 0..100000 using the cassandra-cql gem for Ruby on Rails, and then I counted the users in my database and there were only 10000 users as result. If I create 9000, everything works fine. First I thought the users didn’t exist, but I used the Apollo WebUI for Cassandra, and I could find the user with the id 100000 and users below. Why does this happen?

I know I should use a counter column to provide the number of users in my application, but I want to know if this is a bug or a failure of mine.

def self.create_users
  (0..19000).each do |f|
    @@db.execute("INSERT INTO users (uid, first_name, last_name, email) VALUES (?,?,?,?)", f.to_s, "first_name", "last_name", "email")
  end
end

def self.count_users
  count = @@db.execute("SELECT count(*) FROM users")
  count.fetch do |c|
    return c[0]
  end
end
  • 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-28T02:18:52+00:00Added an answer on May 28, 2026 at 2:18 am

    CQL operations limit both the number of rows and the number of columns that will be returned to the user. By default that limit is 10,000. Because the count(*) operation actually has to fetch out all the rows in order to get the count, it is also limited by the default of 10,000 rows. You could increase the limit for the query (although I don’t recommend it):

    SELECT count(*) FROM users limit 20000;
    

    Note that this is an expensive operation especially when you have a lot of rows. You should anticipate this type of query could take a long time for any medium or large size dataset. If at all possible you should denormalize this count into a counter or some other form that will not require fetching all the rows in your column family.

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

Sidebar

Related Questions

I am now using jQuery tooltip plugin to create some quick reminders for users
when I tried to create a shared library file using the cl command in
UPDATE 3: I created a Visual Studio 2008 test project and tried to create
I have tried to find how to create DLL-s on linux using google, but
I'm having users login to my site using Facebook. They are sent away from
I tried to create this by following the video at http://www.asp.net/learn/videos/video-7026.aspx where Joe Stagner
I tried to create a Style for DataGridTextColumn with the following code <Style TargetType={x:Type
Have anybody ever tried to create thumbnails/previews of MS Office files? I do not
This is the first Python script I've tried to create. I'm reading a xml
I am very, very new to MYSQL.I tried to create a table named option.

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.