I'm working on a patch to materialize sort exprs, both for performance and to fix a crash, and because theres a number of issues to consider, I've put together a brief design doc, if anyone would like to look it over and make suggestions:
https://docs.google.com/document/d/1tBTOzMqW53w1WSYMnqGGyPWVp1hgZGRyQVDmXsHXtTY/edit?usp=sharing Thanks, Thomas
