pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vitalii Tymchyshyn <tivv00@gmail.com>
To: Adarsh Sharma <adarsh.sharma@orkash.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Re-Reason of Slowness of Query
Date: Wed, 23 Mar 2011 12:37:58 +0200
Message-ID: <4D89CD86.4000008@gmail.com> (raw)
In-Reply-To: <4D89C926.8050009@orkash.com>
References: <4D89BABF.4080806@orkash.com>
	<4D89BCD6.6040604@gmail.com>
	<4D89C704.5080603@orkash.com>
	<4D89C778.6050805@gmail.com>
	<4D89C926.8050009@orkash.com>

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

view thread (19+ messages)  latest in thread

Message-ID: <4D89CD86.4000008@gmail.com>
Permalink:  ../4D89CD86.4000008@gmail.com/
Also on:    postgresql.org/message-id/4D89CD86.4000008@gmail.com

 · 

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: tivv00@gmail.com, adarsh.sharma@orkash.com
  Subject: Re: Re-Reason of Slowness of Query
  In-Reply-To: <4D89CD86.4000008@gmail.com>

* 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