Re: [google-appengine] Re: How much faster is key-based lookup compared to a query?

2010-07-19 Thread Toby Reyelts
You want the batch version of the get function,
getObjectsById,
which shouldn't involve multiple round-trips to the database.

On Mon, Jul 19, 2010 at 1:09 PM, Robert Lancer wrote:

> App Engine status has bench marks for this,
> http://code.google.com/status/appengine/
>
> But I can tell you for your situation here the get would be ideal
> because you would actually be using 4 queries because thats what the
> IN clause does behind the scenes, and thats the way your query would
> work with the id == 'id1' || id == 'id2' ...
>
>
> On Jul 19, 12:40 pm, Robert Kluin  wrote:
> > Have you thought about benchmarking this?
> >
> >
> >
> > On Mon, Jul 19, 2010 at 10:51 AM, coltsith  wrote:
> > > Lets say I want to retrieve 4 objects. What would be faster:
> >
> > >1. for (int i = 0; i < 4; i++) {
> >
> > >persistenceManager.getObjectById(object1)
> >
> > >}
> >
> > > or
> >
> > >2. Query = (select * from objects where id == 'id1' || id == 'id2'
> > > || id == 'id3' || id == 'id4')
> >
> > > 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 athttp://
> groups.google.com/group/google-appengine?hl=en.
>
> --
> 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-appeng...@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.
>
>

-- 
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-appeng...@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: How much faster is key-based lookup compared to a query?

2010-07-19 Thread Robert Lancer
App Engine status has bench marks for this, 
http://code.google.com/status/appengine/

But I can tell you for your situation here the get would be ideal
because you would actually be using 4 queries because thats what the
IN clause does behind the scenes, and thats the way your query would
work with the id == 'id1' || id == 'id2' ...


On Jul 19, 12:40 pm, Robert Kluin  wrote:
> Have you thought about benchmarking this?
>
>
>
> On Mon, Jul 19, 2010 at 10:51 AM, coltsith  wrote:
> > Lets say I want to retrieve 4 objects. What would be faster:
>
> >    1. for (int i = 0; i < 4; i++) {
>
> >    persistenceManager.getObjectById(object1)
>
> >    }
>
> > or
>
> >    2. Query = (select * from objects where id == 'id1' || id == 'id2'
> > || id == 'id3' || id == 'id4')
>
> > 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-appeng...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > google-appengine+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/google-appengine?hl=en.

-- 
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-appeng...@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.