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 9791BD1B8E8 for ; Mon, 7 Jun 2004 10:51:57 -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 94179-09 for ; Mon, 7 Jun 2004 13:51:58 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id BF52AD1B3AD for ; Mon, 7 Jun 2004 10:51:54 -0300 (ADT) 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 i57Dputa002605; Mon, 7 Jun 2004 09:51:57 -0400 (EDT) To: "=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" Cc: pgsql-performance@postgresql.org Subject: Re: Relation of cpu_*_costs? In-reply-to: <076f01c44c62$208aa680$0403a8c0@fejleszt4> References: <076f01c44c62$208aa680$0403a8c0@fejleszt4> Comments: In-reply-to "=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" message dated "Mon, 07 Jun 2004 09:36:19 +0200" Date: Mon, 07 Jun 2004 09:51:56 -0400 Message-ID: <2604.1086616316@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200406/59 X-Sequence-Number: 7117 "=?iso-8859-2?B?U1rbQ1MgR+Fib3I=?=" writes: > Last week I fumbled with CPU_TUPLE_COST and revealed that 4 out of 4 tested > queries improved by 10-60% if I changed it from 0.01 (default) to 0.40 > (ugh). Setting it higher did not bring any improvement. That's pretty hard to believe; particularly on modern machines, I'd think that moving it down would make more sense than moving it up. You're essentially asserting that the CPU time to process one tuple is almost half of the time needed to bring a page in from disk. I suspect that your test cases were toy cases small enough to be fully cached and thus not incur any actual I/O ... > [ trying to get a nestloop indexscan plan to be generated ] I believe that the planner's cost model for nestloops with inner indexscan is wrong: it costs each inner iteration independently, when in fact there should be some savings, because at least the topmost levels of the index will soon be fully cached. However, when I tried to work out a proper model of this effect, I ended up with equations that gave higher indexscan costs than what's in there now :-(. So that didn't seem like it would make anyone happy. regards, tom lane