right now, includes triggers multiple select statements, e.g: User.includes(_.payment).includes(_.address).find(id) creates 3 select statements:
- select from users where id = ?
- select from payments where id in (?)
- select from addresses where id in (?)
this is pretty un-performant when we could just do a left join and get everything in one query.
what would this take to do? i'm happy to commit some code if someone can point me in the right direction on where to start
right now,
includestriggers multiple select statements, e.g:User.includes(_.payment).includes(_.address).find(id)creates 3 select statements:this is pretty un-performant when we could just do a left join and get everything in one query.
what would this take to do? i'm happy to commit some code if someone can point me in the right direction on where to start