pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki@enterprisedb.com>
To: Michael Fuhr <mike@fuhr.org>
Cc: Marcin Stępnicki <mstepnicki@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: one column from huge view
Date: Thu, 12 Jul 2007 13:55:43 +0100
Message-ID: <469624CF.5010803@enterprisedb.com> (raw)
In-Reply-To: <20070712125136.GA37198@winnie.fuhr.org>
References: <f74p19$1gb$1@sea.gmane.org>
	<4695EB62.7060307@enterprisedb.com>
	<20070712125136.GA37198@winnie.fuhr.org>

Michael Fuhr wrote:
> On Thu, Jul 12, 2007 at 09:50:42AM +0100, Heikki Linnakangas wrote:
>> Marcin Stępnicki wrote:
>>> Let's say I've got a view with 100 columns and 1mln rows; some of them are
>>> calculated "on the fly". For some reason I want only one column from
>>> this view:
>>>
>>> select col1 from huge_view;
>>>
>>> Now, does PostgreSQL skip all the calculations from other columns and
>>> executes this query faster then select * from huge_view?
>> In simple cases, yes. But for example, if you have a LEFT OUTER JOIN in 
>> the view, the join is performed even if your query doesn't return any 
>> columns from the outer relation. Also, if the calculation contains 
>> immutable functions, it's not skipped.
> 
> Don't you mean "if the calculation contains VOLATILE functions,
> it's not skipped"?

Yes, thanks for the correction.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com



view thread (5+ messages)  latest in thread

Message-ID: <469624CF.5010803@enterprisedb.com>
Permalink:  ../469624CF.5010803@enterprisedb.com/
Also on:    postgresql.org/message-id/469624CF.5010803@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: heikki@enterprisedb.com, mike@fuhr.org, mstepnicki@gmail.com
  Subject: Re: one column from huge view
  In-Reply-To: <469624CF.5010803@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox