Sure, 1st thing to notice that this below is on a massively reduced data set from above issue otherwise the text will go on for days!!
A typical list view does the following for managers, a single page refresh in list view gives: ←[4;36;1mSQL (2593.0ms)←[0m ←[0;1mSELECT count(DISTINCT `managers`.id) AS count_all FROM `managers` LEFT OUTER JOIN `teams` ON teams.manager_id = managers.id LEFT OUTER JOIN `teams` players_managers_join ON (`managers`.`id` = `players_managers_join`.`manager_id`) LEFT OUTER JOIN `players` ON (`p layers`.`team_id` = `players_managers_join`.`id`) LEFT OUTER JOIN `banks` ON banks.manager_id = managers.id ←[0m ←[4;35;1mManager Load (0.0ms)←[0m ←[0mSELECT `managers`.* FROM `managers` ORDER BY managers.`id` ASC LIMIT 0, 15←[0m ←[4;36;1mTeam Load (16.0ms)←[0m ←[0;1mSELECT `teams`.* FROM `teams` WHERE (`teams`.manager_id IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15)) ←[0m ←[4;35;1mTeam Columns (0.0ms)←[0m ←[0mSHOW FIELDS FROM `teams`←[0m ←[4;36;1mPlayer Load (1297.0ms)←[0m ←[0;1mSELECT `players`.* FROM `players` WHERE (`players`.team_id IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67 , 68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150 , 151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225 , 226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271)) ←[0m ←[4;35;1mPlayer Columns (0.0ms)←[0m ←[0mSHOW FIELDS FROM `players`← [0m what is really happening is nearly 100K select statements in the db - use a mysqldb /perf/ monitoring tool to see the relevant select calls to do the above - we get more over head than we need. Not only the select - but the objects are loaded in full, thats a waste of resource, players.*, managers.*, teams.* in list view isnt needed, we need to have this limited to the config.list cols that are selected add debug @record in the _list_actions.html.erb anywhere in the loop, to see what record information is retrieved in list view per entity, yes each player is being loaded in full, everything as per the sql. This is such a big diff in performance. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en -~----------~----~----~----~------~----~------~--~---
