From: | Yavuz Selim Sertoğlu (ETIYA) <yavuz(dot)sertoglu(at)etiya(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
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 14:55:58 |
Message-ID: | AM6PR01MB4817847CE14487DF685CE0049B950@AM6PR01MB4817.eurprd01.prod.exchangelabs.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Thanks for the reply Tom,
Sorry, I couldn't understand. I just copied inside of view and add conditions from query that runs with view.
The comma parts are the same in two queries, one is inside of view the other is in the query.
-----Original Message-----
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Sent: 09 October 2019 16:57
To: Yavuz Selim Sertoğlu (ETIYA) <yavuz(dot)sertoglu(at)etiya(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Query slows when used with view
=?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
[http://www.etiya.com/images/e-newsletter/signature/e_logo_1.png]
[http://www.etiya.com/images/e-newsletter/signature/e_adres.png]<http://www.etiya.com>
[http://www.etiya.com/images/e-newsletter/signature/facebook_icon.png]<https://www.facebook.com/Etiya-249050755136326/> [http://www.etiya.com/images/e-newsletter/signature/linkedin_icon.png] <https://www.linkedin.com/company/etiya?trk=tyah&trkInfo=tas%3Aetiya%2Cidx%3A1-1-1> [http://www.etiya.com/images/e-newsletter/signature/instagram_icon.png] <https://www.instagram.com/etiya_/> [http://www.etiya.com/images/e-newsletter/signature/youtube_icon.png] <https://www.youtube.com/channel/UCWjknu72sHoKKt2nujuU2kA> [http://www.etiya.com/images/e-newsletter/signature/twitter_icon.png] <https://twitter.com/etiya_>
[http://www.etiya.com/images/e-newsletter/signature/0.png]
Yavuz Selim Sertoğlu
Solution Support Specialist II
T:+90 312 265 01 50
M:+90 552 997 52 02
E:yavuz(dot)sertoglu(at)etiya(dot)com<mailto:yavuz(dot)sertoglu(at)etiya(dot)com>
Üniversiteler Mahallesi 1606.cadde No:4 Cyberpark C Blok Zemin kat ofis no :Z25A-Z44
[http://www.etiya.com/images/e-newsletter/signature/tmf_award.jpg] <https://www.etiya.com/press/view/etiya-wins-tm-forum-excellence-award-for-disruptive-innovation>
Yasal Uyari :
Bu elektronik posta asagidaki adreste bulunan Kosul ve Sartlara tabidir;
http://www.etiya.com/gizlilik<www.etiya.com/gizlilik>
ÇIKTI ALMADAN ÖNCE ÇEVREYE OLAN SORUMLULUGUMUZU BIR KEZ DAHA DÜSÜNELIM.
PLEASE CONSIDER THE ENVIRONMENT BEFORE PRINTING ANY DOCUMENT.
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Lewis | 2019-10-09 15:23:14 | Re: Query slows when used with view |
Previous Message | Tom Lane | 2019-10-09 13:57:01 | Re: Query slows when used with view |