Daniel Grace <dgrace(at)wingsnw(dot)com> writes:
> I found some interesting discrepancies with the query planner when
> working with views (and presumably table subqueries) that contain
> windowing functions.
Yeah, there's next to no optimization for window functions ATM.
This will probably get better over time, but don't hold your breath ...
regards, tom lane