unneeded joins on view

From: Linos <info(at)linos(dot)es>
To: pgsql-performance(at)postgresql(dot)org
Subject: unneeded joins on view
Date: 2014-04-16 15:13:24
Message-ID: 534E9E14.5000304@linos.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 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.

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Roxanne Reid-Bennett 2014-04-16 15:42:02 Re: Approach to Data Summary and Analysis
Previous Message sheishere b 2014-04-16 13:05:16 Queries very slow after data size increases