Re: Queries joining views

From: "John D(dot) Burger" <john(at)mitre(dot)org>
To: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Queries joining views
Date: 2006-08-21 17:06:21
Message-ID: b84a95d0ee93bd4777c5dcacccdca8b0@mitre.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-08-21 17:33:22 Re: Queries joining views
Previous Message Tom Lane 2006-08-21 16:58:45 Re: cannot open pg_database