I have an ACCOUNT entity and then a child CONTACT entity. (1 Account has
many Contacts).
I query to get 50 contacts:
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Key accountKey = KeyFactory.createKey("Account", uid);
Query query = new Query("Contact").setAncestor(accountKey);
FetchOptions fetchOptions =
FetchOptions.Builder.withLimit(50).prefetchSize(50);
QueryResultList<Entity> contacts =
datastore.prepare(query).asQueryResultList(fetchOptions);
In case the Account has
300 Contacts the query to get the first 50 contacts takes ----> 21
miliseconds
3000 Contacts the query to get the first 50 contacts takes ----> 234
miliseconds
10000 Contacts the query to get the first 50 contacts takes ----> 1307
miliseconds
Why is this the case? In all three cases I touch only the first 50 contacts.
Theory says Entity Grouping should not affect query performance.
Thank you for your time.
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/AE2XTuaKv80J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.