2 ms·
SQL has dependable performance characteristics... What is not dependable about how window functions are computed?
by tathougies 9y ago
SQL has dependable performance characteristics... What is not dependable about how window functions are computed?
- thom 9y agoWhere clause pushdown through views, or worse CTEs. Views with window functions querying views with window functions. Queries with multiple windows. I didn't just randomly make the statement, modern query planners are an absolute arse to predict in the way that you can 100% of the time in external code. The moment you're doing anything really 'sequency' instead of just calculating some dumb running totals, window functions can become a nightmare, and I just made the statement so people don't automatically think there's a friction-free story for doing general sequence processing in SQL. Not sure why this has offended people so much.