From: | Vitalii Tymchyshyn <tivv00(at)gmail(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:37:58 |
Message-ID: | 4D89CD86.4000008@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
23.03.11 12:19, Adarsh Sharma ???????(??):
> 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.
No significance. You can put anything there. E.g. "*". Simply arbitrary
constant. Exists checks if there were any rows, it does not matter which
columns are there or what is in this columns.
Best regards, Vitalii Tymchyshyn
From | Date | Subject | |
---|---|---|---|
Next Message | tv | 2011-03-23 10:38:23 | Re: Re-Reason of Slowness of Query |
Previous Message | Adarsh Sharma | 2011-03-23 10:19:18 | Re: Re-Reason of Slowness of Query |