jeffgalendez / ajde

Automatically exported from code.google.com/p/ajde
0 stars 0 forks source link

Collections use JOIN instead of loadParents() #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Now, Models loaded in a collection which employs _autoloadParents = true, read 
the data of their parents in single queries (for every model in a collection, a 
query for every parent table).

Total queries [Qn] is now a function of total rows (x) times total relations 
per model (r).

Qn = 1 + x*r

This doesn't scale at all, so an implementation using sql JOIN should be 
written, minimizing the number of queries.

Original issue reported on code.google.com by hong...@gmail.com on 6 Sep 2011 at 10:31