title: Google app engine excessive small datastore operations
body: <p>I'm having some trouble with the google app engine datastore. Ever since the new pricing model was introduced, the cost of running my app has increased massively.</p>
  
  <p>The culprit appears to be "Datastore small operations", which come in at more than 20 Million ops per day! </p>
  
  <p>Has anyone had this problem, I don't think I'm doing an excessive amount of key lookups, and I only have 5000 users, with roughly 10 - 20 requests per minute.</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Ok got some stats, these are after abut 3 hours. Here is what I am seeing in my dashboard, in the billing section:
  <img src="https://i.stack.imgur.com/jioWH.png" alt="Appengine dashboard - billing"></p>
  
  <p>And here are some of the stats:</p>
  
  <p><img src="https://i.stack.imgur.com/qSsJS.png" alt="Stats"></p>
  
  <p>Obviously there are quite a lot of calls to datastore.get. I am starting to think that it is my design that is causing the problem. Those gets correspond to accounts. Every user has an account, but an account can be one of two types, for this I use composition. So each account entity has a link to its sub account entity. 
  As a result when I do a search for nearby users it involves fetching the accounts using the query, and then doing a get on each account to get its sub account. The top request in the stats picture is a call that gets 100 accounts, and then has to do a get on each one.  I would have thought that this was a very light query, but I guess not. And I am still confused by the number of datastore small ops being recorded in my dashboard.</p>