Re: [SQL] can't get rid of unnesesary SORT step in explain plan for hash join

2001-05-14 Thread Alexey Nalbat
On Sun, 13 May 2001, Tom Lane wrote: > 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 an

Re: [SQL] can't get rid of unnesesary SORT step in explain plan for hash join

2001-05-14 Thread Tom Lane
Alexey Nalbat <[EMAIL PROTECTED]> writes: > While executing this query postgres at first creates hash on table > "resellers", then get from index "products_mcr" for rows with > "m_id=123" already ordered (!!!) pairs "c_id,r_id", for each that > pair it checks join condition using hash. If postger

Re: [SQL] can't get rid of unnesesary SORT step in explain plan for hash join

2001-05-12 Thread Tom Lane
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

[SQL] can't get rid of unnesesary SORT step in explain plan for hash join

2001-05-12 Thread Alexey Nalbat
Hello. I need to make some sql-statement to be executed as fast as possible. :) My database consists of: 1) table of categories having 1'000 rows, 2) table of manufacturers having 1'000 rows, 3) table of resellers having 1'000 rows, 4) table of products having 1'000'000 rows. In the products t