Re: View with an outer join - is there any way to optimise this?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rich Doughty <rich(at)opusvl(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: View with an outer join - is there any way to optimise this?
Date: 2005-12-12 22:42:05
Message-ID: 2312.1134427325@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rich Doughty <rich(at)opusvl(dot)com> writes:
> I have a view vw_tokens defined as
> ...
> I cannot however perform a meaningful join against this view.
> ...
> PG forms the full output of the view.

You seem to be wishing that PG would push the INNER JOIN down inside the
nested LEFT JOINs. In general, rearranging inner and outer joins like
that can change the results. There are limited cases where it can be
done without breaking the query semantics, but the planner doesn't
currently have any logic to analyze whether it's safe or not, so it just
doesn't try.

Improving this situation is (or ought to be) on the TODO list, but I dunno
when it will happen.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Wes 2005-12-12 22:58:51 Excessive vacuum times
Previous Message Vivek Khera 2005-12-12 22:15:07 Re: Performance large tables.