X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 6E97E9FB1BF for ; Sun, 23 Jul 2006 00:44:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 32675-07 for ; Sun, 23 Jul 2006 03:44:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from linda-4.paradise.net.nz (bm-4a.paradise.net.nz [203.96.152.183]) by postgresql.org (Postfix) with ESMTP id 2FA5D9FAE4E for ; Sun, 23 Jul 2006 00:44:40 -0300 (ADT) Received: from smtp-1.paradise.net.nz (tclsnelb1-src-1.paradise.net.nz [203.96.152.172]) by linda-4.paradise.net.nz (Paradise.net.nz) with ESMTP id <0J2U009TH7PX4T@linda-4.paradise.net.nz> for pgsql-performance@postgresql.org; Sun, 23 Jul 2006 15:44:26 +1200 (NZST) Received: from [192.168.1.11] (218-101-29-211.dsl.clear.net.nz [218.101.29.211]) by smtp-1.paradise.net.nz (Postfix) with ESMTP id 0FD0F1675FD3; Sun, 23 Jul 2006 15:29:05 +1200 (NZST) Date: Sun, 23 Jul 2006 15:28:48 +1200 From: Mark Kirkwood Subject: Re: Forcing using index instead of sequential scan? In-reply-to: <26827.1153585341@sss.pgh.pa.us> To: Tom Lane , robin.c.smith@bt.com Cc: pgsql-performance@postgresql.org Message-id: <44C2ECF0.1040701@paradise.net.nz> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7bit User-Agent: Thunderbird 1.5.0.4 (X11/20060704) References: <26827.1153585341@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200607/223 X-Sequence-Number: 20083 Tom Lane wrote: > writes: >> 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. > > The reason the website gets indexscans is that he's fooled with the > planner cost parameters. In particular I see that...(snipped) > Indeed I did - probably should have discussed that alteration better in the documentation for the test suite! In addition I was a bit naughty in running the benchmark using size 1 (i.e about 1G) an a box with 2G ram - as this meant that (on the machine I was using then anyway) indexscans on query 0 and 1 were *always* better than the sequential options. A better test is to use the size factor at 2 x physical ram, as then the planners defaults make more sense! (unless or course you *want* to model a data mart smaller than physical ram). Best wishes Mark