Re: tuning SQL - Mailing list pgsql-admin

From Tom Lane
Subject Re: tuning SQL
Date
Msg-id 14789.1012323474@sss.pgh.pa.us
Whole thread Raw
In response to tuning SQL  ("Zhang, Anna" <azhang@verisign.com>)
List pgsql-admin
"Zhang, Anna" <azhang@verisign.com> writes:
> select count(*) from contact a, contact_discard b where a.contacthandle <>
> b.contacthandle;

Did you really mean "<>" here?  If so, the plan you showed us is not for
this query.  The above query is going to take approximately forever to
execute :-(

If you meant "=", then the hash join that the system is using seems like
a perfectly fine plan to me.

            regards, tom lane

pgsql-admin by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: tuning SQL
Next
From: "Zhang, Anna"
Date:
Subject: Re: tuning SQL