Re: Index usage question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jefim Matskin <mjefim(at)sphera(dot)com>
Cc: "'pgsql-general(at)postgresql(dot)org'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Index usage question
Date: 2001-09-04 18:31:34
Message-ID: 27626.999628294@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jefim Matskin <mjefim(at)sphera(dot)com> writes:
> can anyone explain me what is wrong with my query?

Nothing. Hash join is a perfectly respectable way to implement this
query. If the size estimates quoted in the EXPLAIN are in the right
ballpark, I'd not be surprised to find that the planner made the right
choice --- nestloop will certainly be slower, and there's no reason to
think that a merge join based on index scans would be faster either.

You can try "set enable_hashjoin to off" if you want to experiment with
alternate plans, but you should check the actual timing before assuming
that you know better than the planner.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Norbert Zoltan Toth 2001-09-04 18:52:56 Re: Index usage question
Previous Message Francesco Casadei 2001-09-04 18:03:08 Re: Catching errors inside a function