Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id XAA24263 for ; Wed, 24 May 2000 23:00:08 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id WAA19254; Wed, 24 May 2000 22:59:58 -0400 (EDT) To: Joseph Shraibman cc: Stephan Szabo , pgsql-sql@postgresql.org Subject: Re: possible bug with group by? In-reply-to: <392C63FF.F0186004@selectacast.net> References: <392C5819.2FD488A8@selectacast.net> <029101bfc5d6$09f3a960$0c64010a@kick.com> <392C63FF.F0186004@selectacast.net> Comments: In-reply-to Joseph Shraibman message dated "Wed, 24 May 2000 19:21:35 -0400" Date: Wed, 24 May 2000 22:59:58 -0400 Message-ID: <19251.959223598@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200005/134 Joseph Shraibman writes: > But why would group by need to sort it? To insert it into a tree to > make lookups of distinct values faster? No, to bring identical values together. GROUP BY and DISTINCT are both implemented as basically a "sort | uniq" pipeline. regards, tom lane