Skip site navigation (1) Skip section navigation (2)

Re: Re-Reason of Slowness of Query

From: Chetan Suttraway <chetan(dot)suttraway(at)enterprisedb(dot)com>
To: Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Re-Reason of Slowness of Query
Date: 2011-03-23 10:39:37
Message-ID: AANLkTim1XkLf0NkiaffBj8-LNx3+sUuggyYjzO=a-+rT@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-performance
On Wed, Mar 23, 2011 at 3:49 PM, Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>wrote:

>  Vitalii Tymchyshyn wrote:
>
> 23.03.11 12:10, Adarsh Sharma написав(ла):
>
> I just want to retrieve that id 's from page_content which do not have any
> entry in clause2 table.
>
>  Then
> select distinct(p.crawled_page_id) from page_content p
>  where NOT EXISTS (select 1 from  clause2 c where c.source_id =
> p.crawled_page_id);
> is correct query.
>
>
> I can't understand how* select 1 from  clause2 c where c.source_id =
> p.crawled_page_id works too, *i get my output .
>
> What is the significance of 1 here.
>
> Thanks , Adarsh
> **
>
> Best regards, Vitalii Tymchyshyn.
>
>
>
Its the inverted logic for finding crawled_page_id not matching with
source_id.
Actually, the idea was to force index scan on clause2 though.


-- 
Regards,
Chetan Suttraway
EnterpriseDB <http://www.enterprisedb.com/>, The Enterprise
PostgreSQL<http://www.enterprisedb.com/>
 company.

In response to

pgsql-performance by date

Next:From: Chetan SuttrawayDate: 2011-03-23 10:44:22
Subject: Re: Re-Reason of Slowness of Query
Previous:From: tvDate: 2011-03-23 10:38:23
Subject: Re: Re-Reason of Slowness of Query

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group