I would denormalize your model and embed the rider in race history. That way there is no separate lookup and your query returns in 1s. You're doing the relational datastore technique of calculating on reads instead of the non-relational technique of preparing your data on the writes.
On Apr 21, 3:57 am, novarse <stephenmwi...@gmail.com> wrote: > Hello, > I'm trying to retrieve race results from a couple of JDO entities but > the time taken seems too long. Given an event I want to display the > rider's name and number along with their results from the event. > The main objects involved: > RaceHistory: id, riderID, eventID, grade (for the race), time, place, > points > Rider: id, name, grade, number, rhPlace, rhTime, rhPlace, rhPoints > > I send an event id to a method that queries RaceHistory getting all > the records matching the event id. > Then for each RaceHistory record I lookup the Rider and set the Rider > fields (rhGrade, rhTime, rhPlace, rhPoints) from the RaceHistory > record. These Rider objects get added to the result List<Rider> object > which gets returned. > > The time taken to do the RaceHistory query is about 1s. The time to > find and update the Rider records is about 6s. > The total number of records in the RaceHistory entity is 47387. The > query returns 94 records > The total number of records in the Rider entity is 1365. > > Can some recommend a better approach that I may take? (The website > ishttp://actvc.appspot.com/) > Thanks > Stephen > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to google-appengine-j...@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine-java+unsubscr...@googlegroups.com. > For more options, visit this group > athttp://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.