Re: planner question re index vs seqscan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ed Loehr <eloehr(at)austin(dot)rr(dot)com>
Cc: Jeff Hoffmann <jeff(at)propertykey(dot)com>, pghackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: planner question re index vs seqscan
Date: 2000-06-16 22:48:28
Message-ID: 9205.961195708@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ed Loehr <eloehr(at)austin(dot)rr(dot)com> writes:
> But I'm still wondering why it is still doing a seq scan on the
> "ahrn.activity_id = a.id" part when both of those integer columns are
> indexed??

Presumably because it thinks the hash join is cheaper than a nestloop
or merge join would be ... although that seems kinda surprising. What
plans do you get if you try various combinations of
set enable_hashjoin = off;
set enable_mergejoin = off;
set enable_nestloop = off;
How do the cost estimates compare against the actual runtimes for
doing the query each way?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kaare Rasmussen 2000-06-16 23:02:49 Re: Big 7.1 open items
Previous Message D'Arcy J.M. Cain 2000-06-16 22:28:20 Re: Changes to functions and triggers