Re: Forcing using index instead of sequential scan? - Mailing list pgsql-performance

From Mark Kirkwood
Subject Re: Forcing using index instead of sequential scan?
Date
Msg-id 44C2EF69.4020408@paradise.net.nz
Whole thread Raw
In response to Forcing using index instead of sequential scan?  (<robin.c.smith@bt.com>)
List pgsql-performance
robin.c.smith@bt.com wrote:
> I have been testing the performance of PostgreSQL using the simple tool
> found at _http://benchw.sourceforge.net_ however I have found that all
> the queries it run execute with sequential scans. The website where the
> code runs has examples of the execution plan using indexes.
>
> When I disable the sequential plan query 0 and query 1 run faster (
> _http://benchw.sourceforge.net/benchw_results_postgres_history.html_ )
> by using the indexes as suggested by the website.
>
> I have tried increasing the effective_cache_size and reducing the
> random_page_cost to try and force the optimiser to use the index but it
> always uses the sequential scan.
>
> What is the best way to force the use of indexes in these queries?
> Currently testing with version 8.1.4.
>
>

Hi Robin,


Being responsible for this piece of software, I should try to help, only
saw this now sorry (nice to see someone using this).

Unless you really want to reproduce the numbers on the website, it is
best to test with Benchw's scale factor at least 2 x your physical ram,
as this makes the planner's defaults work more sensibly (and models
*most* real world data warehouse situations better!).

Cheers

Mark

pgsql-performance by date:

Previous
From: Mark Kirkwood
Date:
Subject: Re: Forcing using index instead of sequential scan?
Next
From: Michael Stone
Date:
Subject: Re: Forcing using index instead of sequential scan?