Re: Query slows when used with view

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Yavuz Selim Sertoğlu (ETIYA) <yavuz(dot)sertoglu(at)etiya(dot)com>
Cc: "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 13:57:01
Message-ID: 20080.1570629421@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

=?iso-8859-9?Q?Yavuz_Selim_Serto=F0lu_=28ETIYA=29?= <yavuz(dot)sertoglu(at)etiya(dot)com> writes:
> I have a problem with views. When I use view in my query it really slows down(1.7seconds)
> If I use inside of view and add conditions and joins to it, it is really fast(0.7 milliseconds).
> I have no distinct/group/partition by in view so I have no idea why is this happening.
> I wrote queries and plans below.

Those are not equivalent queries. Read up on the syntax of FROM;
particularly, that JOIN binds more tightly than comma.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Yavuz Selim Sertoğlu (ETIYA) 2019-10-09 14:55:58 RE: Query slows when used with view
Previous Message Yavuz Selim Sertoğlu (ETIYA) 2019-10-09 12:31:40 Query slows when used with view