I do not see how pushing this clause to to the view can alter in any way the result. If the latter is true, it is obvious to implement this. A short test without data in another database showed no change in plan with or without the extra clause, in fact it said access predicates on currency view on ID and on wsid. So it looks to me this is a opportunity for PG to add these predicates. The benefit performante wise is huge: the query goes down from 4-6s elapsed time to less than 1s.
Herwig Goemans <herwig.goemans@gmail.com> writes: > I am wondering why a certain query is NOT pushing the where clause to the > view. See query and explain plan:
There's no provision for transitively applying IN clauses to other variables. I'm not entirely sure whether it would be a good idea, but in any case, it's not there and not planned.