Skip site navigation (1) Skip section navigation (2)

Re: Optimisation of INTERSECT expressions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: Phil Endecott <spam_from_postgresql_lists(at)chezphil(dot)org>,pgsql-performance(at)postgresql(dot)org
Subject: Re: Optimisation of INTERSECT expressions
Date: 2004-03-23 15:47:42
Message-ID: 20715.1080056862@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> writes:
> Given a non-unique A, C1 as B>5, c2 as C>5 and the data:
> A | B | C
> 1 | 6 | 1
> 1 | 1 | 6
> The intersect gives 1 row, the and query gives 0 AFAICS.

Another way that the queries are not equivalent is that INTERSECT is
defined to remove duplicate output rows (much like DISTINCT) whereas
the AND form of course won't do that.

			regards, tom lane

In response to

pgsql-performance by date

Next:From: Rosser SchwarzDate: 2004-03-23 16:07:57
Subject: Re: atrocious update performance
Previous:From: Stephan SzaboDate: 2004-03-23 15:14:46
Subject: Re: Optimisation of INTERSECT expressions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group