Re: planner question re index vs seqscan - Mailing list pgsql-hackers

From Tom Lane
Subject Re: planner question re index vs seqscan
Date
Msg-id 9205.961195708@sss.pgh.pa.us
Whole thread Raw
In response to Re: planner question re index vs seqscan  (Ed Loehr <eloehr@austin.rr.com>)
List pgsql-hackers
Ed Loehr <eloehr@austin.rr.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 ofset 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


pgsql-hackers by date:

Previous
From: darcy@druid.net (D'Arcy J.M. Cain)
Date:
Subject: Re: Changes to functions and triggers
Next
From: "Hiroshi Inoue"
Date:
Subject: RE: Big 7.1 open items