Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 235541337B9C for ; Thu, 14 Apr 2011 08:30:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 25942-09 for ; Thu, 14 Apr 2011 11:29:58 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qw0-f46.google.com (mail-qw0-f46.google.com [209.85.216.46]) by mail.postgresql.org (Postfix) with ESMTP id C0217133655C for ; Thu, 14 Apr 2011 08:29:57 -0300 (ADT) Received: by qwk3 with SMTP id 3so815445qwk.19 for ; Thu, 14 Apr 2011 04:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=rspZ5+N736asvCg1bgVgJNJYbDhYMuT1OwVQwjLdnOM=; b=cX9CtmYaDNs0zkhdntaiY8XHn/lyFxKQSMPuOKYB2wvqD8i2Uur6BWqiA6AUPHr1Ls A8ZTkHaFYIMYb418CXMs+IF83jF/YRHt2OYF2xja5RCdTjTJ+EOVxVnOPJi87bw7CES4 IN6Nhf7/YbwKbswT7igjlKaos33kiSiUp2ZWE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=mB9foQrxLhZv/WNU9JW+GZhj/jdIgyTpR7ocAtftrSelR9o04GK01lVehc2vKBTMJl K1098t7Oykbe5eJMjnD+tVBF+voQRfLti6aBzhs0ilaCIaldOEolDWqG8n05hxn2RSJ4 7dWbDwOkt327kIN2YK1A+03CbdZsm8uGOQHQA= Received: by 10.229.221.131 with SMTP id ic3mr400745qcb.239.1302780596559; Thu, 14 Apr 2011 04:29:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.233.146 with HTTP; Thu, 14 Apr 2011 04:29:35 -0700 (PDT) In-Reply-To: <1809.1302739389@sss.pgh.pa.us> References: <20110412171855.GA14292@tux> <4DA496FA.3070908@fuzzy.cz> <8F22D592-23C1-4A3C-94A5-48363332ADD3@darkstatic.com> <4DA4BFA2.5060601@fuzzy.cz> <4DA4D40A.4010200@fuzzy.cz> <4DA56DA8020000250003C783@gw.wicourts.gov> <1809.1302739389@sss.pgh.pa.us> From: =?ISO-8859-1?Q?C=E9dric_Villemain?= Date: Thu, 14 Apr 2011 13:29:35 +0200 Message-ID: Subject: Re: Performance To: Tom Lane Cc: Nathan Boley , Claudio Freire , Kevin Grittner , Ogden , Tomas Vondra , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001 X-Spam-Level: X-Archive-Number: 201104/214 X-Sequence-Number: 43276 2011/4/14 Tom Lane : > Nathan Boley writes: >> FWIW, awhile ago I wrote a simple script to measure this and found >> that the *actual* random_page / seq_page cost ratio was much higher >> than 4/1. > > That 4:1 ratio is based on some rather extensive experimentation that > I did back in 2000. =A0In the interim, disk transfer rates have improved > quite a lot more than disk seek times have, and the CPU cost to process > a page's worth of data has also improved compared to the seek time. > So yeah, you'd likely get a higher number if you redid those experiments > on modern hardware (at least assuming it was rotating media and not SSD). > On the other hand, the effects of caching push the numbers in the other > direction, and modern machines also have a lot more RAM to cache in than > was typical ten years ago. =A0I'm not sure how much point there is in > trying to improve the default number in the abstract --- we'd really > need to have a more robust model of cache effects before I'd trust any > automatic tuning procedure to set the value for me. Well, at spare time, I am doing some POC with "ANALYZE OSCACHE relation;", pg stats are updated accordingly with new data ( it is not finish yet) : at least the percentage in OS cache, maybe the number of groups in cache and/or the distribution. Anyway the idea is to allow the planner to use random and seq page cost to be applyed on the part not-in-cache, without replacing the algo using effective_cache_size. The planner may have one other GUC like 'mem_page_cost' to set a cost on access from cache and use it while estinating the cost... Side effect is that random page cost and seq page cost should be more stable and easiest to set based on a script because they won't have the mixed sources of disk/memory, only the disk acces cost. (if ANALYZE OSCACHE is good enough) --=20 C=E9dric Villemain=A0 =A0 =A0 =A0 =A0 =A0 =A0=A0 2ndQuadrant http://2ndQuadrant.fr/=A0 =A0=A0 PostgreSQL : Expertise, Formation et Suppo= rt