[xquery-talk] Sequence comprehension WAS: SQL vs. XQuery (aka FOR vs FROM and RETURn vs. SELECT)
dflorescu at me.com
Tue Jun 23 16:32:07 PDT 2015
> I'm curious as to what exactly you believe to be features that are necessary to semi-structured data that are unique to XQuery. I've looked at the posts that you've linked to, and e.g. conditionals/typeswitches, functions and recursive functions, and try/catch, are there in pretty much any imperative language with sequence comprehensions,
you ignored one of the FIRST things I put there for a data processing language: the necessity to be FUNCTIONAL in nature.
(aka, 90%+ functional without side effects)
The characteristic of being “functional” is a NECESSITY for being able to do data flow analysis, aka the ability for the compiler to
know automatically what operations will be applied on each piece of data, and what data is being given as input to each operation.
Data flow analysis is a NECESSITY for optimization.
Optimization is a NECESSITY for data processing for large volumes of data.
C# with select-from-where is nearly not as optimizable as XQuery with a scripting extension (as Zorba used to have it for example).
After 5 assignments you lost track of where the data came from and where the data goes, and which data changed where,
and what indexes need automatic updates.
You lost optimizability and logical/physical data independence.
It’s a trade-off.
More information about the talk