At 05:35 PM 5/30/01 -0400, Tom Lane wrote:
>Also, since status.gid is (I assume) unique, what's the use of the
>DISTINCT clause at the top level? Seems like that's costing you
>a useless sort & unique pass ...
>> 2EXPLAIN SELECT distinct s.gid, s.created, count(i.title) AS images
...
>> GROUP BY s.gid,s.created
He's already paying for a sort due to the GROUP BY but of course that
makes the DISTINCT meaningless since s.gid and s.created are already
grouped...
- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.