Re: [HACKERS] temporary indexes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> On Tue, Feb 28, 2006 at  3:02 pm, in message
<20060228210232.GW82012@xxxxxxxxxxxxx>, "Jim C. Nasby"
<jnasby@xxxxxxxxxxxxx>
wrote: 
> 
> Maybe it's just the way my twisted mind thinks, but I generally
prefer
> using a JOIN when possible...

Definitely.  But sometimes you don't want one row from a table for each
qualifying row in another table, you want one row from the table if one
or more qualifying rows exist in the other table.  Those are the cases
in question here.  Don't suggest that I just let the duplicates happen
and use DISTINCT, that is much more prone to logic errors in complex
queries, and typically optimizes worse.

-Kevin



[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux