Re: Recheck condition

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Josh Harrison <joshques(at)gmail(dot)com>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Recheck condition
Date: 2007-11-30 12:55:42
Message-ID: 20071130125542.GF1837@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Josh Harrison escribió:

> Thanks...
> I have 1 more question in the same line...
>
> *Query1*
> SELECT person_id FROM person WHERE (column1=1 AND column2='62')
> INTERSECT
> SELECT person_id FROM person WHERE (column1=1 AND column2='189')

Hmm, I think INTERSECT (and EXCEPT) is pretty stupid in Postgres in
general. Maybe INTERSECT ALL could be a bit faster, because it can
avoid the sort steps. Make sure you eliminate duplicates if they are a
concern.

--
Alvaro Herrera http://www.amazon.com/gp/registry/DXLWNGRJD34J
"[PostgreSQL] is a great group; in my opinion it is THE best open source
development communities in existence anywhere." (Lamar Owen)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Childs 2007-11-30 12:59:23 Re: PostgresSQL vs Ingress
Previous Message Josh Harrison 2007-11-30 12:51:31 Re: Recheck condition