Re: [PERFORM] temporary indexes

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jim Nasby" <jnasby(at)pervasive(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>,<pgsql-performance(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PERFORM] temporary indexes
Date: 2006-03-01 15:35:33
Message-ID: 44056AE5.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

>>> On Tue, Feb 28, 2006 at 3:02 pm, in message
<20060228210232(dot)GW82012(at)pervasive(dot)com>, "Jim C. Nasby"
<jnasby(at)pervasive(dot)com>
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-03-01 15:39:00 Re: Initdb on Windows 2003
Previous Message Michael Fuhr 2006-03-01 15:26:20 Re: Reg:lo_open error..pls help me

Browse pgsql-performance by date

  From Date Subject
Next Message PFC 2006-03-01 15:43:53 Re: Bad plan on a view
Previous Message Tom Lane 2006-03-01 15:16:08 Re: Bad plan on a view