Re: one column from huge view

Поиск
Список
Период
Сортировка
Искать
От
Michael Fuhr
Тема
Re: one column from huge view
Дата
Msg-id
20070712125136.GA37198@winnie.fuhr.org
Ответ на
Re: one column from huge view (Heikki Linnakangas)
Список
Дерево обсуждения
one column from huge view Marcin Stępnicki <mstepnicki@gmail.com>
Re: one column from huge view Heikki Linnakangas <heikki@enterprisedb.com>
Re: one column from huge view Tom Lane <tgl@sss.pgh.pa.us>
Re: one column from huge view Michael Fuhr <mike@fuhr.org>
Re: one column from huge view Heikki Linnakangas <heikki@enterprisedb.com>
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"?

-- 
Michael Fuhr
В списке pgsql-performance по дате отправления
От: smiley2211
Дата:
Сообщение: Re: TIMING A QUERY ???
От: Heikki Linnakangas
Дата:
Сообщение: Re: one column from huge view
FAQ