X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A0C70D1B179 for ; Sun, 13 Jun 2004 14:59:29 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 70868-09 for ; Sun, 13 Jun 2004 17:59:26 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id E9FD8D1B16E for ; Sun, 13 Jun 2004 14:59:24 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i5DHxOFX026743; Sun, 13 Jun 2004 13:59:24 -0400 (EDT) To: Vitaly Belman Cc: Bruno Wolff III , pgsql-performance@postgresql.org Subject: Re: Additional select fields in a GROUP BY In-reply-to: References: <2393942843.20040613062117@012.net.il> <20040613135212.GA3260@wolff.to> Comments: In-reply-to Vitaly Belman message dated "Sun, 13 Jun 2004 20:35:36 +0300" Date: Sun, 13 Jun 2004 13:59:24 -0400 Message-ID: <26742.1087149564@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/145 X-Sequence-Number: 7203 Vitaly Belman writes: > Notice that the GROUP BY items added the following to the plan: > -> Sort (cost=10454.67..10600.83 rows=58466 width=47) > Sort Key: s.series_id, s.series_name, s.series_picture Oh, I see: in the first case you need no sort at all because the output of the indexscan is already known to be sorted by s.series_id. I was thinking of a sort with more or fewer sort columns, but that's not the issue here. regards, tom lane