Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Auto-convert queries to keys_only=True queries that pull entities from cache #118

Closed
GoogleCodeExporter opened this issue Jun 10, 2015 · 12 comments

Comments

@GoogleCodeExporter
Copy link

keys_only=True queries count as "small datastore ops".

Under certain scenarios, many of the entities returned from a query may already 
be in cache - in particular memcache.

It would be great if the NDB framework could automatically convert a query to 
keys_only=True and then a get_multi() using the returned keys so that the 
entities would be returned from the caches (of course, only if present).

For queries that return frequently accessed entities, this could end up being a 
significant cost (and performance?) savings and could all be provided under the 
hood by NDB.

The API might be as simple as:

  Entity.query(use_cached_entities=True)

Of course, the following would raise some kind of exception because it's 
inconsistent:

  Entity.query(use_cached_entities=True, keys_only=False)

Original issue reported on code.google.com by jcoll...@vendasta.com on 21 Dec 2011 at 4:13

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant