Re: [PERFORM] window function induces full table scan

2014-01-03 Thread Tom Lane
Thomas Mayer writes: > To implement the optimization, subquery_is_pushdown_safe() needs to > return true if pushing down the quals to a subquery which has window > functions is in fact safe ("quals that only reference subquery > outputs that are listed in the PARTITION clauses of all window func

Re: [PERFORM] window function induces full table scan

2014-01-03 Thread Thomas Mayer
Am 03.01.2014 15:54, schrieb Tom Lane: Thomas Mayer writes: To implement the optimization, subquery_is_pushdown_safe() needs to return true if pushing down the quals to a subquery which has window functions is in fact safe ("quals that only reference subquery outputs that are listed in the PA

Re: [PERFORM] window function induces full table scan

2014-01-03 Thread Tom Lane
Thomas Mayer writes: > ... "mark" ...: Do I understand you correctly, that you prefer doing the > decision elsewhere and store the result (safe/unsafe) boolean value > besides to the subquery output fields? For the push-down, a subquery > output field must be available anyways. See check_outpu

Re: [PERFORM] window function induces full table scan

2014-01-03 Thread Thomas Mayer
Am 03.01.2014 19:04, schrieb Tom Lane: I think you need to read the code around subquery_is_pushdown_safe and qual_is_pushdown_safe some more. regards, tom lane . In general, I'd need to go throught the pg source code which will take some time. For instance, I wanted