unneeded joins on view

Поиск
Список
Период
Сортировка
От Linos
Тема unneeded joins on view
Дата
Msg-id 534E9E14.5000304@linos.es
обсуждение исходный текст
Ответы Re: unneeded joins on view  (Heikki Linnakangas <hlinnakangas@vmware.com>)
Список pgsql-performance
Hello all,

I am trying to simplify some of the queries I use with my database creating a big view of all the possible attributes
myitems can have, the view is rather large: 

http://pastebin.com/ScnJ8Hd3


I thought that Postgresql would optimize out joins on columns I don't ask for when I use the view but it doesn't, this
query:

SELECT referencia
FROM articulo_view
WHERE referencia = '09411000';


Have this query plan:

http://explain.depesz.com/s/4lW0


Maybe I am surpassing some limit? I have tried changing from_collapse_limit and join_collapse_limit but still the
plannerjoin the unneeded tables. 

Is possible to tell Postgresql do the right thing? If so, how? Thanks!

Regards,
Miguel Angel.


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

Предыдущее
От: sheishere b
Дата:
Сообщение: Queries very slow after data size increases
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: unneeded joins on view