Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Ycaxy-0005i1-EY for pgsql-performance@arkaria.postgresql.org; Mon, 30 Mar 2015 14:47:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Ycaxx-0000dG-OR for pgsql-performance@arkaria.postgresql.org; Mon, 30 Mar 2015 14:47:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Ycaxw-0000d6-I7 for pgsql-performance@postgresql.org; Mon, 30 Mar 2015 14:47:00 +0000 Received: from nm21-vm3.bullet.mail.ne1.yahoo.com ([98.138.91.151]) by magus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Ycaxr-0006FQ-BV for pgsql-performance@postgresql.org; Mon, 30 Mar 2015 14:46:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1427726811; bh=WTzXnhnx2HujmaxSq9Yd+i0nWbYUo3kmIbqARl/YqjU=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=kJqIxnWZKMltAkFSLtH218PHKKD443U/DYmExB08lmTxPGFDzjr8M1zk4XdLm82sAZvfo/LioIWUddbIcOAsvvye0S771KgXKVDmk4Q1oHmPvc0veT8UcU6Guxu2aHX/VFeNeLXIy2aad4U7Yu5k2H+skC9BgKOC6goE6C5YYqew3Jr5GDL173CE6O4wB+1W8jAr439JUQ4OIWEapCFm/7GPHmQwRYvlJGi7R30gk925KwQnq3BqFzK/MbtxvTYKOLq7WLfPgJh/mfopktjzukOqyJ86+0rtRmqx9a7AcsSzIjN7J3WiH6mDMJ6WyVUyTr6sAHWIAdZUFoXpQUGREw== Received: from [98.138.100.115] by nm21.bullet.mail.ne1.yahoo.com with NNFMP; 30 Mar 2015 14:46:51 -0000 Received: from [98.138.87.4] by tm106.bullet.mail.ne1.yahoo.com with NNFMP; 30 Mar 2015 14:46:51 -0000 Received: from [127.0.0.1] by omp1004.mail.ne1.yahoo.com with NNFMP; 30 Mar 2015 14:46:51 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 807073.13120.bm@omp1004.mail.ne1.yahoo.com X-YMail-OSG: Vw4VZlcVM1n80MmgaP9X4Ys0cyCP4M.TriTvE.4xysXLyRK_55AGhCdIwHmGDCH 4mZ_0wS.7F1i_9QO9.T42YvE6zW84vVQxRo0mdSXzS_9eKDdAI9JSkkR.z.ElKLU5_7fAFb9TWr2 cZ2MLM_MLceOCYOVTxSmhQT4ox4o89k0tt3NcFBuGSQES9FuD5M9pQYa1ZZfidv5eksY4Nc4S8bG lrEg8tk6fSIF031FdNtjzVh1P44fhKPHq0G.48hEDqBe4Y.s7f72Egp7b1zja.YKXUgfJ.cXx7Lf xN6SPnyittbiiSt.oaA.6_YkFf_ZCYuwGoe4ParWAeWBP2ld6WXqppo35C2a5hToXQ4wGCMJZ491 CUJ1HwiYJa06PPhIds_HGtC.L6rm5GL21hMG2AgJj_KsbRoWSZj_fvoQ1JSa69wIQeJsMLdSkl7h w5w6WeB4vVz4iOGIwzQEMyi8W_ZNbDq8V6Z8qGX5hwkpGvzoeAFC8dZjVis5A3KvNIAiGav6vcDy A1jR9xEXPCwLuRwmHm8Dci5SN.5cjF9wpIWx86BEaqgwKVHOPg6ctrpvp62W4zcjQ5sjK_KrjCuE hejfI3HbM2bb.Wc9c9DgilZbzLg3zvLXKy4NEcmhTXWu3kk5omp79xwM- Received: by 98.138.101.176; Mon, 30 Mar 2015 14:46:51 +0000 Date: Mon, 30 Mar 2015 14:46:04 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: Tom Lane , "Carson, Leonard" Cc: "pgsql-performance@postgresql.org" Message-ID: <1760411806.1238053.1427726764629.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <1174.1427562844@sss.pgh.pa.us> References: <1174.1427562844@sss.pgh.pa.us> Subject: Re: views much slower in 9.3 than 8.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 2142 X-Pg-Spam-Score: -2.0 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org Tom Lane wrote: > But the other problem is that the planner considers less-than-1% > differences in cost estimates to be "in the noise", which means > that it's not going to consider cost differences of less than > 1480 units in the remaining join steps to be significant. This > is how come we end up with the apparently brain-dead decisions to > use seqscans on some of the other tables such as "pi" and "ac": > comparing the seqscan to a potential inner indexscan, the total > cost of the join is "the same" according to the 1% rule, The 1% rule itself might be something to add to the R&D list. I have seen it cause big problems in production, although the users in that case had made a mistake which significantly contributed to it being an issue. They had used the enable_seqscan = off setting for one query which they had been unable to wrestle into good performance in other ways, but accidentally neglected to turn it back on after that query. Now, seqscans were rarely a good idea with their permanent tables, but they had a couple queries which used very small temporary tables with no indexes. It chose the seqscan in spite of the setting; but, when run with seqscans off, that gave all candidate plans such a high cost that they all looked "equal" and the tie-breaker logic picked a horrible one. (The faster plans did have lower cost, but not by enough to exceed the 1% threshold.) Now, had they not made a questionable choice in disabling seqscan in production, compounded by an error in not turning it off again, they would not have had their main web application slow to unusable levels at times -- but it seems to me that it might be reasonable to have some absolute cost maximum difference test that needs to be met in addition to the percentage difference, as kind of a "safety" on this foot-gun. I'm not sold on this as being a good idea, and had not been planning on raising it without further research; but since it plays into this other scenario it seems worth mentioning as material for potential R&D. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance