4 ms·
SQL has a very solid ground in research - a lot of - in relational algebra. If you try to make a query language that is a dsl for anything without a really diff
by rs86 8y ago
SQL has a very solid ground in research - a lot of - in relational algebra. If you try to make a query language that is a dsl for anything without a really different data model underneath, you will accomplish nothing great.
- repsilat 8y agoIn the world of "theory meets engineering" SQL is pretty embarrassing too. Read this: https://www.dcs.warwick.ac.uk/~hugh/TTM/HAVING-A-Blunderful-Time.html https://www.dcs.warwick.ac.uk/~hugh/TTM/HAVING-A-Blunderful-... Just being built on the relational model is a tiny part of what makes SQL what it is (which is largely catastrophic, as languages go.) It says little about how queries are executed, indexes, syntax, data types, yada yada... And the relational calculus itself isn't super lovely as a base... Turing completeness is a nice thing to have, after all.
- siscia 8y ago> It says little about how queries are executed, indexes, syntax, data types, yada yada... I believe that this is the whole idea of SQL or any declarative language. You want to express your query without saying anything about indexes, how data are retrieved, how joins are executed and so on. That is (suppose to be) a feature.
- repsilat 8y agoSure, those things aren't specified in SQL, but again -- that's a feature of SQL, not the relational model. You could just as easily have an imperative relational language as a declarative one, so those theoretical foundations can be used to justify very little of the query language.
- dragonwriter 8y ago> Turing completeness is a nice thing to have, after all. It is, and plain old non-procedural SQL has it.
- repsilat 8y agoHmm, that's an interesting argumentative fork to run into -- either a) SQL is Turing complete and departs from the relational algebra that the earlier post said gave it a solid theoretical grounding, or b) SQL is not Turing complete, and so loses useful expressive power. For the actual fact of the matter, you're right. I had no idea. See https://wiki.postgresql.org/index.php?title=Cyclic_Tag_System&oldid=15106 https://wiki.postgresql.org/index.php?title=Cyclic_Tag_Syste... for concrete code. I think the specific departure from the "traditional" relational model that gets them there is "WITH RECURSIVE". I don't know whether there are other ways to get there. Personally I think it's the right side of the fork to land on.
- coldtea 8y ago>And the relational calculus itself isn't super lovely as a base... Turing completeness is a nice thing to have, after all. And then you have C++ templates all over again...
- makapuf 8y agoWhich is actually the case for influxdb : there are no relations in it. Remember that what's used in influxql is the syntax, not the data model. However I must admit I don't see a particularly big need to change the query language to something completely different.