[google-appengine] Re: 1 Select = 6 Datastore API calls?

2009-03-13 Thread Sharp-Developer.Net

Interesting question, would be great to hear from Google folks.
--
Alex


On Mar 12, 7:47 am, Peter Cicman  wrote:
> Hi, i would like to deeper understand, how datastore calls counter
> works.
>
> Trying out simple query:
> samples = db.GqlQuery('SELECT * FROM Sample')
>
> produces 6 Datastore API Calls, whats the reason for this?
>
> Results:
>
> Write 100 instances = 100 API Calls, CORRECT
> Count 100 instances = 100 API Calls, CORRECT
> Read 100 instances = 6 API Calls, ???
> Delete 100 instances = 13 API Calls, ??? - uses Select also...
>
> My very simple model:
>
> class Sample(db.Model):
>         content = db.BlobProperty()
>
> & content fore every instance is always 100B long.
>
> Somebody knows?
>
> Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: 1 Select = 6 Datastore API calls?

2009-03-13 Thread bFlood

i thought I saw somewhere (maybe one of the IRC logs) that reads are
batched in groups of 20 for each db call. it was one of the reasons
they said to use a list of keys for get_by_key_name rather calling
them individually. don't know for sure though

cheers
brian

On Mar 13, 9:56 am, "Sharp-Developer.Net"
 wrote:
> Interesting question, would be great to hear from Google folks.
> --
> Alex
>
> On Mar 12, 7:47 am, Peter Cicman  wrote:
>
> > Hi, i would like to deeper understand, how datastore calls counter
> > works.
>
> > Trying out simple query:
> > samples = db.GqlQuery('SELECT * FROM Sample')
>
> > produces 6 Datastore API Calls, whats the reason for this?
>
> > Results:
>
> > Write 100 instances = 100 API Calls, CORRECT
> > Count 100 instances = 100 API Calls, CORRECT
> > Read 100 instances = 6 API Calls, ???
> > Delete 100 instances = 13 API Calls, ??? - uses Select also...
>
> > My very simple model:
>
> > class Sample(db.Model):
> >         content = db.BlobProperty()
>
> > & content fore every instance is always 100B long.
>
> > Somebody knows?
>
> > Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---



[google-appengine] Re: 1 Select = 6 Datastore API calls?

2009-03-13 Thread Marzia Niccolai
Hi,

It depends on how you are retrieving the results.  If you use fetch() it
should be a single query in the datastore.  However, if you iterate over the
query, it does batch the calls in groups of 20.

-Marzia

On Fri, Mar 13, 2009 at 7:03 AM, bFlood  wrote:

>
> i thought I saw somewhere (maybe one of the IRC logs) that reads are
> batched in groups of 20 for each db call. it was one of the reasons
> they said to use a list of keys for get_by_key_name rather calling
> them individually. don't know for sure though
>
> cheers
> brian
>
> On Mar 13, 9:56 am, "Sharp-Developer.Net"
>  wrote:
> > Interesting question, would be great to hear from Google folks.
> > --
> > Alex
> >
> > On Mar 12, 7:47 am, Peter Cicman  wrote:
> >
> > > Hi, i would like to deeper understand, how datastore calls counter
> > > works.
> >
> > > Trying out simple query:
> > > samples = db.GqlQuery('SELECT * FROM Sample')
> >
> > > produces 6 Datastore API Calls, whats the reason for this?
> >
> > > Results:
> >
> > > Write 100 instances = 100 API Calls, CORRECT
> > > Count 100 instances = 100 API Calls, CORRECT
> > > Read 100 instances = 6 API Calls, ???
> > > Delete 100 instances = 13 API Calls, ??? - uses Select also...
> >
> > > My very simple model:
> >
> > > class Sample(db.Model):
> > > content = db.BlobProperty()
> >
> > > & content fore every instance is always 100B long.
> >
> > > Somebody knows?
> >
> > > Thanks!
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~--~~~~--~~--~--~---