Re: Planner incorrectly choosing seq scan over index scan

From: Tobias Brox
Subject: Re: Planner incorrectly choosing seq scan over index scan
Date: ,
Msg-id: 20050801223708.GE17649@tobias.lan
(view: Whole thread, Raw)
In response to: Planner incorrectly choosing seq scan over index scan  (Meetesh Karia)
Responses: Re: Planner incorrectly choosing seq scan over index scan  (Meetesh Karia)
List: pgsql-performance

Tree view

Planner incorrectly choosing seq scan over index scan  (Meetesh Karia, )
 Re: Planner incorrectly choosing seq scan over index scan  (Tobias Brox, )
  Re: Planner incorrectly choosing seq scan over index scan  (Meetesh Karia, )
 Re: Planner incorrectly choosing seq scan over index scan  (John Arbash Meinel, )
  Re: Planner incorrectly choosing seq scan over index scan  (Meetesh Karia, )
   Re: Planner incorrectly choosing seq scan over index scan  (Tom Lane, )
    Re: Planner incorrectly choosing seq scan over index scan  (Meetesh Karia, )
     Re: Planner incorrectly choosing seq scan over index scan  (Meetesh Karia, )

[Meetesh Karia - Tue at 12:19:27AM +0200]
> We're using 8.0.3 and we're seeing a problem where the planner is choosing a
> seq scan and hash join over an index scan. If I set enable_hashjoin to off,
> then I get the plan I'm expecting and the query runs a lot faster. I've also
> tried lowering the random page cost (even to 1) but the planner still
> chooses to use the hash join.

Have you tried increasing the statistics collection?

--
Tobias Brox, +47-91700050
Nordicbet, IT dept


pgsql-performance by date:

From: Tom Lane
Date:
Subject: Re: Planner incorrectly choosing seq scan over index scan
From: Meetesh Karia
Date:
Subject: Re: Planner incorrectly choosing seq scan over index scan