Re: Performance issues

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Re: Performance issues
Дата
Msg-id 55073272.20209@BlueTreble.com
обсуждение исходный текст
Ответ на Re: Performance issues  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Ответы Re: Performance issues
Список pgsql-performance
On 3/13/15 7:12 PM, Tomas Vondra wrote:
> (4) I suspect many of the relations referenced in the views are not
>      actually needed in the query, i.e. the join is performed but
>      then it's just discarded because those columns are not used.
>      Try to simplify the views as much has possible - remove all the
>      tables that are not really necessary to run the query. If two
>      queries need different tables, maybe defining two views is
>      a better approach.

A better alternative with multi-purpose views is to use an outer join
instead of an inner join. With an outer join if you ultimately don't
refer to any of the columns in a particular table Postgres will remove
the table from the query completely.
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com


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

Предыдущее
От: Jim Nasby
Дата:
Сообщение: Re: Best VPS provider for running performant PostgreSQL database server
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: MusicBrainz postgres performance issues