Re: Calculation of unused columns

From: Gerhard Wiesinger <lists(at)wiesinger(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Calculation of unused columns
Date: 2009-10-19 17:54:45
Message-ID: alpine.LFD.2.00.0910191950200.15515@bbs.intern
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Sun, 18 Oct 2009, Tom Lane wrote:

> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Sun, Oct 18, 2009 at 1:59 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>>> Even if country.id is a primary or unique key?
>
>> Well, we currently don't have any logic for making inferences based on
>> unique constraints.
>
> Huh?
> http://archives.postgresql.org/pgsql-committers/2009-09/msg00159.php
>
> Admittedly it's just one case and there's lots more to be done, but it's
> more than nothing. So this is a *potential* argument for trying to trim
> subquery outputs. What I'm not sure about is whether there are common
> cases where this would be applicable below a non-flattenable subquery.
>

Wow. That's IHMO a major improvement in the optimizer. Is this also valid
for views?

In the area of views this might even be a killer feature since one can
define a view with many columns and when only e.g. one is used query is
still optimal. I had today such a situation where I created a new view to
be ~24 times faster (with a lot of left outer joins).

Is the patch only for 8.5 or even backported to 8.4 and 8.3?

Thnx.

Ciao,
Gerhard

--
http://www.wiesinger.com/

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-10-19 17:58:24 Re: Calculation of unused columns
Previous Message Simon Riggs 2009-10-19 17:48:58 Re: Calculation of unused columns