Received: from sss.pgh.pa.us (sss.pgh.pa.us [216.151.103.158]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f4D1s8A62590 for ; Sat, 12 May 2001 21:54:08 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.3/8.11.3) with ESMTP id f4D1ruR22031; Sat, 12 May 2001 21:53:56 -0400 (EDT) To: alexey@price.ru cc: pgsql-sql@postgresql.org Subject: Re: can't get rid of unnesesary SORT step in explain plan for hash join In-reply-to: <01051118284600.06900@workshop.price.ru> References: <01051118284600.06900@workshop.price.ru> Comments: In-reply-to Alexey Nalbat message dated "Fri, 11 May 2001 15:47:55 +0400" Date: Sat, 12 May 2001 21:53:56 -0400 Message-ID: <22028.989718836@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200105/114 X-Sequence-Number: 2930 Alexey Nalbat writes: > So, my question is: how can I get rid of this unnesesary "Sort" step > in the execution plan for hash join? You can't, because it's not unnecessary. Hash join doesn't promise to produce its outputs in any particular order. But the Unique filter needs to see its inputs in order by the fields being made unique. regards, tom lane