pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Yavuz Selim Sertoưlu (ETIYA) <yavuz.sertoglu@etiya.com>
Cc: pgsql-performance@lists.postgresql.org <pgsql-performance@lists.postgresql.org>
Subject: Re: Query slows when used with view
Date: Wed, 09 Oct 2019 09:57:01 -0400
Message-ID: <20080.1570629421@sss.pgh.pa.us> (raw)
In-Reply-To: <AM6PR01MB4817E28570A83C86BED9B05C9B950@AM6PR01MB4817.eurprd01.prod.exchangelabs.com>
References: <AM6PR01MB4817E28570A83C86BED9B05C9B950@AM6PR01MB4817.eurprd01.prod.exchangelabs.com>

=?iso-8859-9?Q?Yavuz_Selim_Serto=F0lu_=28ETIYA=29?= <yavuz.sertoglu@etiya.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





view thread (7+ messages)  latest in thread

Message-ID: <20080.1570629421@sss.pgh.pa.us>
Permalink:  ../20080.1570629421@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20080.1570629421@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, yavuz.sertoglu@etiya.com, pgsql-performance@lists.postgresql.org
  Subject: Re: Query slows when used with view
  In-Reply-To: <20080.1570629421@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox