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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:19:42+00:00 2026-05-15T04:19:42+00:00

I have a datastore with around 1,000,000 entities in a model. I want to

  • 0

I have a datastore with around 1,000,000 entities in a model. I want to fetch 10 random entities from this.

I am not sure how to do this? can someone help?

  • 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-15T04:19:43+00:00Added an answer on May 15, 2026 at 4:19 am

    Assign each entity a random number and store it in the entity. Then query for ten records whose random number is greater than (or less than) some other random number.

    You’ll also need to sort on your random number column, otherwise, Google App Engine will pick 10 entries that are greater (or less than) your number, but it will pick them in a non random way. So, if you are picking records whose random number is greater than a random number, you’d sort asending on the column, otherwise you’d sort decending.

    This isn’t totally random, however, since entities with nearby random numbers will tend to show up together. If you want to beat this, do ten queries based around ten random numbers, but this will be less efficient.

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

Sidebar

Related Questions

I have this datastore model: class Person(db.Model): person_name = db.StringProperty(required = True) nacionality =
I have a datastore model representing items in an ecommerce site: class Item(db.Model): CSIN
I am new to sencha touch. I have a datastore and i want to
I have two data sets in google app engine datastore. class First_Set(db.Model): start_time =
I want to export the datastore that I have running in App Engine into
How can I reformulate an Entity Data Model query to work around a parsing
I'm not so sure if this is really trivial to do and I'm just
I am now on python 2.7 and have datastore admin working I want to
Have a GAE datastore kind with several 100'000s of objects in them. Want to
In the AppEngine console I have enabled datastore administration. I also enabled the remote

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.