unneeded joins on view

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 my items 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 planner join the unneeded tables.

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

Regards,
Miguel Angel.


-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance




[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux