in reply to Re^3: Efficient search through a huge dataset
in thread Efficient search through a huge dataset
SELECT t1.blah FROM t1 LEFT OUTER JOIN t2 ON (t1.blah = t2.blah) WHERE t1.blah IS NOT NULL AND t2.blah IS NULL
It's the correct way to rewrite the NOT EXISTS (about 100x faster in my tests) and is faster than the MINUS because it doesn't have to pull both result sets into memory, then do an expensive ARRAYCOMPARE on them.
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Efficient search through a huge dataset
by Corion (Patriarch) on Oct 20, 2004 at 11:39 UTC | |
by dragonchild (Archbishop) on Oct 20, 2004 at 13:28 UTC |