Re: Reason of Slowness of query

From: Vitalii Tymchyshyn <tivv00(at)gmail(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Reason of Slowness of query
Date: 2011-03-23 07:25:34
Message-ID: 4D89A06E.2020202@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Chetan Suttraway 2011-03-23 07:25:35 Re: Reason of Slowness of query
Previous Message Samuel Gendler 2011-03-23 07:20:29 Re: Reason of Slowness of query