Less lines of code than vanilla C while abusing query planning as a state machine is peak engineering malpractice. I love it.
I noticed the cedardb.com blogpost on the project is slashdotted at the moment, but the game itself plays just fine.
1. Write a query planner that compiles SQL into CUDA kernels
2. Write a VRAM-resident backend for Postgres
3. ???
4. Profit!
> Matrix multiplication is after all nothing but an aggregate sum over a cross join.
https://www.vldb.org/pvldb/vol13/p1919-wang.pdfThey converted linear algebra expressions into relational algebra expressions, optimized them using equality saturation and converted back into linear algebra. With some noticeable speedups.
They used relational algebra for optimization because relational algebra has canonical form - there is only one most optimal expression.
And, equality saturation is most efficiently implemented using generic join algorithm.