by assface · 8y ago · 0 comments
* MemSQL (http://highscalability.com/blog/2016/9/7/code-generation-the...)
* Tableau/TUM HyPer (https://blog.acolyer.org/2016/05/23/efficiently-compiling-ef...)
* CMU Peloton (http://db.cs.cmu.edu/papers/2017/p1-menon.pdf)
* Vitesse (https://www.youtube.com/watch?v=PEmVuYjhQFo)
I think Greenplum was talking about doing this too, but that was about a year ago (http://engineering.pivotal.io/post/orca-profiling/)
Most systems just compile the predicates (Impala, SparkSQL).
A lot of companies are talking about adding this now. The performance gains are significant.
Compiling everything is questionable. There's not much point re-compiling runtime code or code outside of the hot path, it's expensive and doesn't bring any benefit.
E.g. things that aren't beneficial to compile per query include: * Loops over a column of the same datatype, with no query specific branches (e.g. decoding a column of integers) * Other static code, e.g. some hash table operations * Outer loops that don't execute frequently * Rarely executed code, e.g. error handling.
There are two general designs that let you compile only the necessary things. 1) the runtime calls into compiled code for hot loops vs 2) the compiled code drives the query and calls into the runtime. A lot of the systems you mentioned do the second, but Impala does the first, which seems to be the source of some misunderstanding. Also there were some cases where hot loops in earlier versions of Impala weren't compiled, but that's changed - generally we try to ensure that all hot loops are compiled.
I think generally the optimal design wouldn't be complete query compilation, but rather something more like a traditional JIT that selectively compiles parts of the query.
Source: work on Impala's query compilation
https://docs.microsoft.com/en-us/sql/relational-databases/in...
Edit: down votes... hah
* HyperDex (http://hyperdex.org/)
* HyperGraphDB (http://www.hypergraphdb.org/)
* HyperSQL (http://hsqldb.org/)
* Hypertable (http://hypertable.org/)
"The commercial license for HyPer, a spin-off of TUM, has been acquired by Tableau Software"