On Mar 6, 2009, at 7:05 PM, Chuck Hill wrote:

from the Entry table, the Game table and the TeamPopup table that are associated with a single pool via joins from the pool's entries to each entry's games to each game's teams.

To process 1 pool that has say 300 entries, each entry having 63 Games and each Game having 2 Teams, That's 63 rows from the Entry table, 18900 distinct rows from the Games table and 37800 distinct rows from the Teams table. My first question is, with a pool name in hand, how do I fashion the qualifier so that all the Pool's associated Game Rows and Team rows that I need for processing are batch fetched in?

Have you turned on SQL logging to see what is getting sent to the database?
No.

Without knowing what is actually happening, you have no (realistic) hope of optimizing it. Turn it on. Look at what each like is causing. Too many single row selects? Would an index improve performance?
Here's an interesting (LONG) one. t_team_popup-->gameID IS indexed, but I'm not sure why it would be trying to traverse from t_team_popup back to t_game???

"SELECT t0."c_game_index", t0."gameID", t0."c_group", t0."id", t0."c_pool_type", t0."c_seed", t0."c_team_id", t0."c_team_pos" FROM "t_team_popup" t0 WHERE (t0."gameID" = 1043321 OR t0."gameID" = 1043355 OR t0."gameID" = 1043352 OR t0."gameID" = 1043341 OR t0."gameID" = 1043310 OR t0."gameID" = 1043295 OR t0."gameID" = 1043325 OR t0."gameID" = 1043331 OR t0."gameID" = 1043348 OR t0."gameID" = 1043335 OR t0."gameID" = 1043338 OR t0."gameID" = 1043353 OR t0."gameID" = 1043313 OR t0."gameID" = 1043300 OR t0."gameID" = 1043294 OR t0."gameID" = 1043312 OR t0."gameID" = 1043298 OR t0."gameID" = 1043339 OR t0."gameID" = 1043350 OR t0."gameID" = 1043326 OR t0."gameID" = 1043320 OR t0."gameID" = 1043308 OR t0."gameID" = 1043324 OR t0."gameID" = 1043327 OR t0."gameID" = 1043351 OR t0."gameID" = 1043322 OR t0."gameID" = 1043337 OR t0."gameID" = 1043302 OR t0."gameID" = 1043305 OR t0."gameID" = 1043344 OR t0."gameID" = 1043347 OR t0."gameID" = 1043323 ... (you get the idea, it goes on over 50 times this long)



Does your model have Batch Faulting configured for these relationships?
http://wiki.objectstyle.org/confluence/display/WO/EOF-Modeling-EOModeler#EOF-Modeling-EOModeler-BatchFaulting
Yes

Details?
Pool---->>Entry no batch fetch
Entry---->Game batch fetches 65.
Game---->TeamPopup batch fetches 5



Are you using prefetching keypaths with the fetch spec?
http://developer.apple.com/documentation/MacOSXServer/Reference/WO54_Reference/com/webobjects/eocontrol/EOFetchSpecification.html#setPrefetchingRelationshipKeyPaths(com.webobjects.foundation.NSArray)

I'm using Wonder, which I think does that. Hopefully I'm using it correctly...

ERXBatchFetchUtilities.batchFetch(currPool.entries(), Entry.GAMES.append(Game.TEAM_POPUPS));

That is _batch_ fetching, not _pre_fetching. They do similar things, but prefetching is easier to use for most cases.




In the end, by creating a new EC and a new, dedicated Object Store to process each pool, the performance isn't too bad and it doesn't degrade, but sounds like the raw row route might be even faster, or do the "joins" (I'm no SQL/DB guru) make that more difficult?

Faster than what? If what you have is not tuned now, fixing that might make it faster and better. With raw rows you lose EOs. You get raw pieces of data. Which brings us back to, "Maybe this is best done in SQL".


Chuck

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to