You want the batch version of the get function,
getObjectsById<http://db.apache.org/jdo/api20/apidocs/javax/jdo/PersistenceManager.html#getObjectsById(java.util.Collection)>,
which shouldn't involve multiple round-trips to the database.

On Mon, Jul 19, 2010 at 1:09 PM, Robert Lancer <robert.lan...@gmail.com>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 <robert.kl...@gmail.com> wrote:
> > Have you thought about benchmarking this?
> >
> >
> >
> > On Mon, Jul 19, 2010 at 10:51 AM, coltsith <conla...@gmail.com> 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<google-appengine%2bunsubscr...@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<google-appengine%2bunsubscr...@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.

Reply via email to