Re: Opptimizing projections containing unused columns

Поиск
Список
Период
Сортировка
От Andrus
Тема Re: Opptimizing projections containing unused columns
Дата
Msg-id 13C10FDF15EB41D7A7DFF7A04FB17E94@andrusnotebook
обсуждение исходный текст
Ответ на Re: Opptimizing projections containing unused columns  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Opptimizing projections containing unused columns
Список pgsql-general
Tom,

> Don't worry about it.  All modern Postgres versions ignore columns that
> aren't actually used in the query --- at least for examples as simple as
> this one.  In cases where you intentionally defeat optimization (eg via
> OFFSET 0 in a sub-select) it's possible that the sub-select will compute
> all its output columns even though the upper query doesn't use 'em all.
>
> The width field in EXPLAIN output offers a good hint as to how many
> columns the query is actually fetching.

thank you very much.
I don't use OFFSET clause in those queries and have servers starting at 8.0
version.
So I hope this works.

I have also a related question.
Inner query returns about 500000 records, outer query returns about 10000
records.

Is it OK to put all filters to outer query WHERE clase?
Or should I move as many filter conditions as possible to inner query so
that inner query returns 10000 records instead of 500000 records.

Is there difference in perfomance if inner query returs large number of rows
which are filtered only by outer query ?

Andrus.


В списке pgsql-general по дате отправления:

Предыдущее
От: "Joshua Tolley"
Дата:
Сообщение: Re: UPDATE and Indexes and Performance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Opptimizing projections containing unused columns