Skip site navigation (1) Skip section navigation (2)

Re: Forcing using index instead of sequential scan?

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: robin(dot)c(dot)smith(at)bt(dot)com
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Forcing using index instead of sequential scan?
Date: 2006-07-23 03:39:21
Message-ID: 44C2EF69.4020408@paradise.net.nz (view raw or flat)
Thread:
Lists: pgsql-performance
robin(dot)c(dot)smith(at)bt(dot)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

In response to

pgsql-performance by date

Next:From: Michael StoneDate: 2006-07-23 11:07:26
Subject: Re: Forcing using index instead of sequential scan?
Previous:From: Mark KirkwoodDate: 2006-07-23 03:28:48
Subject: Re: Forcing using index instead of sequential scan?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group