X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6D47252812 for ; Fri, 1 Jul 2005 23:40:59 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 65548-03 for ; Sat, 2 Jul 2005 02:40:50 +0000 (GMT) Received: from sccmmhc91.asp.att.net (sccmmhc91.asp.att.net [204.127.203.211]) by svr1.postgresql.org (Postfix) with ESMTP id 59F3D52801 for ; Fri, 1 Jul 2005 23:40:49 -0300 (ADT) Received: from juju.arbash-meinel.com ([12.214.18.81]) by sccmmhc91.asp.att.net (sccmmhc91) with ESMTP id <20050702024053m9100ngas9e>; Sat, 2 Jul 2005 02:40:53 +0000 Received: by juju.arbash-meinel.com (Postfix, from userid 505) id F0097560B3; Fri, 1 Jul 2005 21:40:52 -0500 (CDT) Received: from [192.168.1.11] (liliana.arbash-meinel.com [192.168.1.11]) by juju.arbash-meinel.com (Postfix) with ESMTP id 9A77C56070; Fri, 1 Jul 2005 21:40:49 -0500 (CDT) Message-ID: <42C5FEB1.6090601@arbash-meinel.com> Date: Fri, 01 Jul 2005 21:40:49 -0500 From: John A Meinel User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: emil@baymountain.com Cc: pgsql-performance@postgresql.org Subject: Re: Planner constants for RAM resident databases References: <200507012159.39041.emil@baymountain.com> In-Reply-To: <200507012159.39041.emil@baymountain.com> X-Enigmail-Version: 0.92.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig870DC8A41B021865FE229B70" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.048 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200507/10 X-Sequence-Number: 13251 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig870DC8A41B021865FE229B70 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Emil Briggs wrote: >I'm working with an application where the database is entirely resident in RAM >(the server is a quad opteron with 16GBytes of memory). It's a web >application and handles a high volume of queries. The planner seems to be >generating poor plans for some of our queries which I can fix by raising >cpu_tuple_cost. I have seen some other comments in the archives saying that >this is a bad idea but is that necessarily the case when the database is >entirely resident in RAM? > >Emil > > > Generally, the key knob to twiddle when everything fits in RAM is random_page_cost. If you truly have everything in RAM you could set it almost to 1. 1 means that it costs exactly the same to go randomly through the data then it does to go sequential. I would guess that even in RAM it is faster to go sequential (since you still have to page and deal with L1/L2/L3 cache, etc). But the default random_page_cost of 4 is probably too high for you. John =:-> --------------enig870DC8A41B021865FE229B70 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Cygwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCxf6xJdeBCYSNAAMRArOgAKCo02YFzzjRTAOqW113BryLR2l59QCdEb10 WwGMl/V15c6lANMuXPQkN1U= =nHp/ -----END PGP SIGNATURE----- --------------enig870DC8A41B021865FE229B70--