3 ms·
>My opinion is that SQL should be for computers to write. This would put it firmly in the same category as LLVM IR. Although I partially agree with the high le
by summerlight 2y ago
>My opinion is that SQL should be for computers to write. This would put it firmly in the same category as LLVM IR.
Although I partially agree with the high level idea of this statement (let's accept the reality; no mature database is going to support your new shiny query language anytime soon), SQL is not the most convenient language to be written by code generator. Actually this is a sort of nightmare; a seemingly simple plan optimization would completely change the layout of the query so you're going to have a decent chance to write a full query rewrite stage just for the sake of workaround for a specific query engine. Google's SQL pipe proposal seems to make it a bit better but it has the same problem of new query languages unless it's broadly adopted.