X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id B1B18D1B80B for ; Mon, 9 Feb 2004 16:38:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 08535-08 for ; Mon, 9 Feb 2004 12:38:45 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 19A8FD1DD07 for ; Mon, 9 Feb 2004 12:38:44 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i19Gcg2E020552; Mon, 9 Feb 2004 11:38:42 -0500 (EST) To: Greg Stark Cc: Christoph Haller , paul@tmsl.demon.co.uk (Paul Thomas), pgsql-sql@postgresql.org Subject: Re: Index not used - now me In-reply-to: <878yjcntra.fsf@stark.xeocode.com> References: <200402091502.QAA19246@rodos> <878yjcntra.fsf@stark.xeocode.com> Comments: In-reply-to Greg Stark message dated "09 Feb 2004 10:43:21 -0500" Date: Mon, 09 Feb 2004 11:38:42 -0500 Message-ID: <20551.1076344722@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/87 X-Sequence-Number: 16778 Greg Stark writes: > You could also try lowering random_page_cost. Some people find as low as 1.2 > or so to be useful, but that would almost certainly be lying to postgres about > the costs of random access and would cause it to use index scans aggressively > even when they're not faster. If the database is small enough to mostly fit in kernel disk cache, then a very low random_page_cost is telling the truth, not lying. One might also think about raising the various CPU_xxx cost parameters, since CPU effort becomes proportionally much more significant when "I/O" only requires a trip to kernel buffers. However, Christoph's example looks to me like a classic case of testing a toy table and assuming the results will extrapolate to production-size cases. This table is small enough that it hardly matters which method the planner chooses. I'd counsel being very wary about adjusting the cost settings based on only this example. regards, tom lane