facebook/presto — pull request #1477 by nileema (2014-07-09 01:17:01+00:00)
Title: Optimize row_number window function 

Identify the query shape with a filter on the row_number() and rewrite it for optimal execution.
Examples of query shapes affected by this:
https://gist.github.com/nileema/71d0099d804a10cb172b