Re: Query slows when used with view

From: Michael Lewis <mlewis(at)entrata(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Yavuz Selim Sertoğlu (ETIYA) <yavuz(dot)sertoglu(at)etiya(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Query slows when used with view
Date: 2019-10-09 15:32:37
Message-ID: CAHOFxGpi_CnCPhLr0ebudxm7Y0gpP1TTrRwDyfdUTv9Hn9WWoQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>
> When you join to a view, the view sticks together, as if they were all in
> parentheses. But when you substitute the text of a view into another
> query, then they are all on the same level and can be parsed differently.
>
> Consider the difference between "1+1 * 3", and "(1+1) * 3"
>

I thought from_collapse_limit being high enough meant that it will get
re-written and inlined into the same level. To extend your metaphor, that
it would be 1 * 3 + 1 * 3.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2019-10-09 16:07:47 Re: Query slows when used with view
Previous Message Jeff Janes 2019-10-09 15:24:00 Re: Query slows when used with view