Re: Forcing using index instead of sequential scan?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



robin.c.smith@xxxxxx 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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux