Welcome Guest, Not a member yet? Register   Sign In
Model relationships
#5

[eluser]obiron2[/eluser]
I have the same sort of logic issue.

Lets say I have a league table. I may to pull up the cumulative results for a location (lots of players) or for a player (lots of locations). Each data set would access the results table with location id and player id as filters in the where clause, so they are the same query.

Should they go into the players model, the locations model, both (and be written twice), a separate results model which is loaded as required and would require an initial query to get a list of players or locations and then a loop thorugh the results set for each cumulative results query.

I tested this on a more complex model (F1 league calculator) and what could be done in one BIG query but broke MVC rules ended up running over 1600 queries and almost killed the database.

Obiron


Messages In This Thread
Model relationships - by El Forum - 01-13-2009, 06:24 PM
Model relationships - by El Forum - 01-13-2009, 10:52 PM
Model relationships - by El Forum - 01-13-2009, 11:06 PM
Model relationships - by El Forum - 01-14-2009, 02:44 AM
Model relationships - by El Forum - 01-14-2009, 04:30 AM
Model relationships - by El Forum - 01-14-2009, 05:36 AM
Model relationships - by El Forum - 01-14-2009, 06:11 AM
Model relationships - by El Forum - 01-14-2009, 06:31 AM
Model relationships - by El Forum - 01-14-2009, 08:23 AM
Model relationships - by El Forum - 01-15-2009, 12:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB