my question more theoretical , why rdbms/drivers return data way it, not how find correct set, nor how find it. i'm pretty familiar sql, there 1 thing annoyed sense of economy. consider following "class" graph: a { field1, ..., field9 b_items = [ b1, ..., bn ] } b { field1, ..., field6 c_items = [ c1, ..., cm ] } c { field1, field2 } we have few objects, each object has many b objects, , each b objects has lots of c objects. count(a) < count(b) << count(c) . now use rdbms store it, because relations cool , optimizers smart, can virtually in milliseconds, provided there plan , index set. i'll skip table creation code, should obvious, , go straight select: select * left join b on b.a_id = a.id left join c on c.b_id = b.id whatever database server returns result set combined of columns tables, joined sort-of tree: a.f1 .... a.f9 b.f1 .... b.f6 c.f1 c.f2 --------------------------------------------------- 1 1 ...