209 | | If the foreign key is not "id", you should create an index in MySQL for the foreign key's column. The speed degradation will be awefull if the joinTable has 1000+ entries, and no index is present (~10 or more seconds per list page) |
| 209 | If the foreign key is not "id", you should create an index in MySQL for the foreign key's column. The speed degradation will be awefull if the joinTable has 1000+ entries, and no index is present (~10 or more seconds per list page). |
| 210 | |
| 211 | A real example from the evaluations controller, to join in the Group, the Event, and the Course |
| 212 | {{{ |
| 213 | #!php |
| 214 | $joinTables = array( |
| 215 | array( "joinTable" => "groups", |
| 216 | "joinModel" => "Group", |
| 217 | "localKey" => "group_id"), |
| 218 | array( "joinTable" => "events", |
| 219 | "joinModel" => "Event", |
| 220 | "localKey" => "event_id"), |
| 221 | array("joinTable" => "courses", |
| 222 | "joinModel" => "Course", |
| 223 | "localkey" => "course_id") |
| 224 | ); |
| 225 | }}} |