Does any body knows why ObjectionJs makes a sub query when using Eager methods?
ModelA.query().withGraphJoined('tableB')
The sql query is
select "tableA"."id" as "id" "tableA" left join (select "tableB". from "tableB") as "tableB" on "tableB"."id" = "tableA"."fkB"
instead of
select "tableA"."id" as "id" "tableA" left join tableB
Does this cause any performance issue?
This question was answered at least here and there has been discussion about it every now and then on the gitter support channel https://github.com/Vincit/objection.js/issues/301
Basically it shouldn't be a problem unless you are using mysql which is older than 5.7. So for mssql, oracle, postgres and mysql > 5.7 the performance is the same for both queries.