In case you are interested, there have been two VLDB papers recently on implementing efficient analytic functions: I mostly implemented those for feature completeness. They were no substantial part of my thesis (which was exploiting implicit/in-memory order for representation of order-based and nested queries), although
Hi Richard, Am 27.02.2017 um 15:48 schrieb Richard Wesley: they could be important for future work (since partitioning and order are both implicitly given).
Efficient Processing of Window Functions in Analytical SQL Queries http://www.vldb.org/pvldb/vol8/p1058-leis.pdf This one I read, which outlines a method (Removable Cumulative Aggregation) for amortized O(n) window functions with bounded preceding window. It should be relatively easy to adapt my code for window functions whose accumulator has a group property (sum, avg, count).
Again, I don't know whether my code is useful. But given that none of those exist yet in vanilla MonetDB, it might be beneficial to provide a solution that already works to some degree (at least within MAL). Regards, Moritz