Alexey Nalbat <[EMAIL PROTECTED]> 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 ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://www.postgresql.org/search.mpl