Andreas Pflug <Andreas.Pflug@web.de> writes:
> Actually, there are cases when a view can impact performance.
> If you are joining a view, it seems to be treated as a subquery, that
> might have a much larger result than you would like.
> Imagine
> SELECT something
> FROM A JOIN B JOIN C ...
> WHERE A.primaryKeyFoo=1234 ...
> where C is a view, containing JOINs itself, I observed a query plan
> (7.3.2) like
> A JOIN B JOIN (D JOIN E)
> instead of
> A JOIN B JOIN D JOIN E which would be much more efficient for the
> A.primaryKeyFoo restriction.
This is not the view's fault though --- the same would have happened
if you'd written explicitly
FROM A JOIN B JOIN (D JOIN E)
7.4 will be less rigid about this (with or without a view ...)
regards, tom lane