Re: [appengine-java] Cheapest way to run an SQL EXISTS query with Datastore API?

2010-10-26 Thread Ikai Lan (Google)
The cheapest way is to use the value you are checking for as a datastore key, then to do a get by key. A query always results in an index operation followed by a fetch by key, so you are reducing the need for an index lookup. -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger: http

[appengine-java] Cheapest way to run an SQL EXISTS query with Datastore API?

2010-10-26 Thread Dan Dubois
What is the absolute cheapest way (CPU cost) theoretically to run an SQL EXISTS query with the Datastore API? I imagine FetchOptions would be FetchOptions.Builder.withChunkSize(1).limit(1).prefetchSize(1) and probably option 1 below. Query query = new Query("KIND");