News for hackers. Stuff that matters.
Re:How and why GraphQL will influence the Sourcehut alpha by goto11 on Friday June 12, 2020 @03:35AM (#23496969)
But why wont it optimize as well as hand-written SQL? How can the query optimizer even tell the difference? Surely the SQL is transformed into some kind of syntax-independent abstract query tree before it is passed to the optimizer.
Re:How and why GraphQL will influence the Sourcehut alpha by jmull on Friday June 12, 2020 @01:33PM (#23501609)
There are a lot of ways to write a SQL query against a set of tables, given a set of input parameters, to get the desired result. (Not just syntactic or other superficial differences, but differences in logic and how relationships are specified.)

And, of course, an optimizer will handle different SQL queries differently.

Re:How and why GraphQL will influence the Sourcehut alpha by mixedCase on Friday June 12, 2020 @09:14AM (#23498872)
No such thing. The database interface is SQL. The query optimizer is something run in the database.
Re:How and why GraphQL will influence the Sourcehut alpha by goto11 on Friday June 12, 2020 @09:36AM (#23499077)
Yes I mean inside the database engine. The engine receives SQL and parses it and then pass the query tree to the optimizer which generate a query plan. My question is how the optimizer could have problems if the SQL is generated as opposed to hand-written? How could that make a difference?
Re:How and why GraphQL will influence the Sourcehut alpha by mixedCase on Friday June 12, 2020 @03:18PM (#23502636)
As mentioned in another the comment, because SQL that is hand-written for non-trivial cases will too often be better than what an ORM generates.
Re:How and why GraphQL will influence the Sourcehut alpha by goto11 on Saturday June 13, 2020 @01:33PM (#23511081)
This is so hand-wavy I can't really argue against it.