Ok. Say I have many (>1000)  Model entities with two properties 'x'
and 'date'.    What is the most efficient query to fetch say the
latest 200 entities  where x > 50.   I don't care what their 'date's
are as long as I get the latest and x > 50

Thanks again for your help.


On Jun 22, 4:11 pm, "Nick Johnson (Google)" <nick.john...@google.com>
wrote:
> Consider precalculating this data and storing it against another entity.
> This will save a lot of work on requests.
>
> -Nick Johnson
>
>
>
> On Mon, Jun 22, 2009 at 3:55 PM, herbie <4whi...@o2.co.uk> wrote:
>
> > No the users won't need to read 1000 entities, but I want to calculate
> > the average of a  property from the latest 1000 entities.
>
> > On Jun 22, 3:30 pm, "Nick Johnson (Google)" <nick.john...@google.com>
> > wrote:
> > > Correct. Are you sure you need 1000 entities, though? Your users probably
> > > won't read through all 1000.
>
> > > -Nick Johnson
>
> > > On Mon, Jun 22, 2009 at 3:23 PM, herbie <4whi...@o2.co.uk> wrote:
>
> > > > So to be sure to get the latest 1000 entities I should add a datetime
> > > > property to my entitie model and filter and sort on that?
>
> > > > On Jun 22, 1:42 pm, herbie <4whi...@o2.co.uk> wrote:
> > > > > I know that if there are more than 1000 entities that match a query,
> > > > > then only 1000 will  be return by fetch().  But my question is which
> > > > > 1000? The last 1000 added to the datastore?  The first 1000 added to
> > > > > the datastore? Or is it undedined?
>
> > > > > Thanks
> > > > > Ian
>
> > > --
> > > Nick Johnson, App Engine Developer Programs Engineer
> > > Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration
> > Number:
> > > 368047
>
> --
> Nick Johnson, App Engine Developer Programs Engineer
> Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number:
> 368047
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to