Alban Hertroys wrote:
> We have a number of views that join tables, and we have queries that
> join those views. Some relatively large tables are involved.
> We added indexes that match our query constraints as much as possible,
> and that does work if we explicitly query the tables with all the
> involved joins, instead of the views. However, if we query the views,
> the planner starts using a filter instead of the desired index...
Anecdotally, I had a situation recently where I got different plans
depending on whether I queried a join of a view against itself, or
"macro expanded" the view by hand. I was =very= surprised at this.
- John D. Burger
MITRE