3 ms·
Syntax doesn't matter much, what in the optimizer does. I think that right now a lot of SQL problems are baggage. Too many people are battle-taught to write ha
by galkk 3y ago
Syntax doesn't matter much, what in the optimizer does.
I think that right now a lot of SQL problems are baggage. Too many people are battle-taught to write hard to read, complex, deeply nested queries because older engines were bad at handling modern constructs (e.g. look, somebody got common table expession (CTE) here, let's materialize it immediately). So older style was mess of
SELELT FROM (SELECT FROM (SELECT FROM A JOIN (SELECT ) B ON A.x=B.x))) etc
With things like improved CTEs handling by engines, it is getting easier and easier to write understandable, composable queries of structure like below. Add modern window functions that decrease another layer of complexity, things like SELECT * EXCEPT, more complex TOP statements like TOP X FOLLOWING etc and SQL will be even more simpler.
WITH A AS (
),
WITH B AS (
),
WITH C AS (
SELECT y FROM A)
,
SELECT result from C
WHERE
and in new-ish world minor improvements of different syntax shape (like that PRQL) do not really bring the benefit, from my POV. Yes, you can rewrite it in imperative looking pipeline, but optimizer can throw away some of it etc
Yes, there are things that can and should be done better in SQL, but I have yet to see compelling case for cosmetic, syntactical differences.