unneeded joins on view - Mailing list pgsql-performance

From Linos
Subject unneeded joins on view
Date
Msg-id 534E9E14.5000304@linos.es
Whole thread Raw
Responses Re: unneeded joins on view  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List 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 by date:

Previous
From: sheishere b
Date:
Subject: Queries very slow after data size increases
Next
From: Heikki Linnakangas
Date:
Subject: Re: unneeded joins on view