Re: can't get rid of unnesesary SORT step in explain plan for hash join - Mailing list pgsql-sql

From Tom Lane
Subject Re: can't get rid of unnesesary SORT step in explain plan for hash join
Date
Msg-id 22028.989718836@sss.pgh.pa.us
Whole thread Raw
In response to can't get rid of unnesesary SORT step in explain plan for hash join  (Alexey Nalbat <alexey@price.ru>)
Responses Re: can't get rid of unnesesary SORT step in explain plan for hash join
List pgsql-sql
Alexey Nalbat <alexey@price.ru> 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


pgsql-sql by date:

Previous
From: Hans-Jürgen Schönig
Date:
Subject: SELECT timestamp('2001-06-12'::date - '2000-06-12'::date)
Next
From: Tom Lane
Date:
Subject: Re: SELECT timestamp('2001-06-12'::date - '2000-06-12'::date)