Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6AF149F946C for ; Tue, 12 Dec 2006 12:36:15 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 84251-01 for ; Tue, 12 Dec 2006 12:36:02 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from westnet.com (westnet.com [216.187.52.2]) by postgresql.org (Postfix) with ESMTP id 24FD69F931E for ; Tue, 12 Dec 2006 12:36:01 -0400 (AST) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.13.8/8.13.8) with ESMTP id kBCGa2gc020190 for ; Tue, 12 Dec 2006 11:36:02 -0500 (EST) Received: from localhost (gsmith@localhost) by westnet.com (8.13.8/8.13.2/Submit) with ESMTP id kBCGa2m3020184 for ; Tue, 12 Dec 2006 11:36:02 -0500 (EST) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Tue, 12 Dec 2006 11:36:01 -0500 (EST) From: Greg Smith X-X-Sender: gsmith@westnet.com To: pgsql-performance@postgresql.org Subject: Re: New to PostgreSQL, performance considerations In-Reply-To: <20061212161106.GF22782@alvh.no-ip.org> Message-ID: References: <20061211173105.GH16692@mathom.us> <20061211184726.GI16692@mathom.us> <457DA782.3060506@modgraph-usa.com> <8a0c7af10612111422x6bdcc0c2p7cbfeb5a7b0e0374@mail.gmail.com> <2FC0D8E7-F8ED-452F-BB13-FB665B516E7F@purefiction.net> <20061212123252.GR16692@mathom.us> <42B14BCF-B745-4F94-B5EA-97997744A4D5@purefiction.net> <3356.1165938462@sss.pgh.pa.us> <20061212161106.GF22782@alvh.no-ip.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200612/301 X-Sequence-Number: 22357 On Tue, 12 Dec 2006, Alvaro Herrera wrote: > While skimming over the pgbench source it has looked to me like it's > necessary to pass the -s switch (scale factor) to both the > initialization (-i) and the subsequent (non -i) runs. For non-custom runs, it's computed based on the number of branches. Around line 1415 you should find: res = PQexec(con, "select count(*) from branches"); ... scale = atoi(PQgetvalue(res, 0, 0)); So it shouldn't be required during the run, just the initialization. However, note that there were some recent bug fixes to the scaling implementation, and I would recommend using the version that comes with 8.2 (pgbench 1.58 2006/10/21). It may compile fine even if you copy that pgbench.c into an older version's contrib directory; it's certainly a drop-in replacement (and improvement) for the pgbench 1.45 that comes with current Postgres 8.1 versions. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD