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 3E26856796 for ; Tue, 15 Mar 2005 23:41:24 +0000 (GMT) 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 67038-06 for ; Tue, 15 Mar 2005 23:41:23 +0000 (GMT) Received: from gizmo03ps.bigpond.com (gizmo03ps.bigpond.com [144.140.71.13]) by svr1.postgresql.org (Postfix) with SMTP id 3101956795 for ; Tue, 15 Mar 2005 23:41:20 +0000 (GMT) Received: (qmail 10109 invoked from network); 15 Mar 2005 23:41:20 -0000 Received: from unknown (HELO psmam05.bigpond.com) (144.135.25.81) by gizmo03ps.bigpond.com with SMTP; 15 Mar 2005 23:41:20 -0000 Received: from cpe-203-45-203-73.qld.bigpond.net.au ([203.45.203.73]) by psmam05.bigpond.com(MAM REL_3_4_2a 107/8150853) with SMTP id 8150853; Wed, 16 Mar 2005 09:41:20 +1000 Message-ID: <42377293.1010801@bigpond.net.au> Date: Wed, 16 Mar 2005 09:41:07 +1000 From: David Brown User-Agent: Mozilla Thunderbird 1.0RC1 (Windows/20041201) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gregory Stark Subject: Re: cpu_tuple_cost References: <87psy1mq66.fsf@stark.xeocode.com> In-Reply-To: <87psy1mq66.fsf@stark.xeocode.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.735 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_WHOIS X-Spam-Level: X-Archive-Number: 200503/310 X-Sequence-Number: 11015 Gregory Stark wrote: >The "this day and age" argument isn't very convincing. Hard drive capacity >growth has far outstripped hard drive seek time and bandwidth improvements. >Random access has more penalty than ever. > > In point of fact, there haven't been noticeable seek time improvements for years. Transfer rates, on the other hand, have gone through the roof. Which is why I would question the published tuning advice that recommends lowering it to 2 for arrays. Arrays increase the effective transfer rate more than they reduce random access times. Dropping from 4 to 2 would reflect going from a typical single 7200rpm ATA drive to a 15000rpm SCSI drive, but striping will move it back up again - probably even higher than 4 with a big array (at a guess, perhaps the relationship might be approximated as a square root after allowing for the array type?). With default settings, I've seen the planner pick the wrong index unless random_page_cost was set to 2. But in testing on an ATA drive, I achieved slightly better plan costings by increasing cpu_tuple_cost (relative to cpu_index_tuple_cost - by default it's only a factor of 10) and actually *raising* random_page_cost to 5! So why pick on one parameter? It's all going to vary according to the query and the data. I agree with Tom 100%. Pulling levers on a wonky model is no solution.