From: Vitalii Tymchyshyn <tivv00@gmail.com>
To: pgsql-performance@postgresql.org
Subject: Re: Reason of Slowness of query
Date: Wed, 23 Mar 2011 09:25:34 +0200
Message-ID: <4D89A06E.2020202@gmail.com> (raw)
In-Reply-To: <4D899301.7070301@orkash.com>
References: <4D899301.7070301@orkash.com>
23.03.11 08:28, Adarsh Sharma ???????(??):
> *
> *I perform a join query on it as :
>
> * explain analyze select distinct(p.crawled_page_id) from page_content
> p , clause2 c where p.crawled_page_id != c.source_id ;*
Your query is wrong. This query will return every *crawled_page_id* if
clause2 has more then 1 source_id. This is because DB will be able to
find clause with source_id different from crawled_page_id. You need to
use "not exists" or "not in".
Best regards, Vitalii Tymchyshyn.
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
Subject: Re: Reason of Slowness of query
In-Reply-To: <4D89A06E.2020202@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