Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YcbzC-0008FC-Be for pgsql-performance@arkaria.postgresql.org; Mon, 30 Mar 2015 15:52:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YcbzB-0007Xs-Px for pgsql-performance@arkaria.postgresql.org; Mon, 30 Mar 2015 15:52:21 +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 1YcbzA-0007Xl-LY for pgsql-performance@postgresql.org; Mon, 30 Mar 2015 15:52:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Ycbz3-0007Uw-3J for pgsql-performance@postgresql.org; Mon, 30 Mar 2015 15:52:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t2UFq9jI015850; Mon, 30 Mar 2015 11:52:10 -0400 From: Tom Lane To: Kevin Grittner cc: "Carson, Leonard" , "pgsql-performance@postgresql.org" Subject: Re: views much slower in 9.3 than 8.4 In-reply-to: <1760411806.1238053.1427726764629.JavaMail.yahoo@mail.yahoo.com> References: <1174.1427562844@sss.pgh.pa.us> <1760411806.1238053.1427726764629.JavaMail.yahoo@mail.yahoo.com> Comments: In-reply-to Kevin Grittner message dated "Mon, 30 Mar 2015 14:46:04 -0000" Date: Mon, 30 Mar 2015 11:52:09 -0400 Message-ID: <15849.1427730729@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Kevin Grittner writes: > 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. Perhaps. But it does make for a significant difference in planner speed, and I would argue that any case where it really hurts is by definition a cost estimation failure somewhere else. > [ disable_cost skews the behavior pretty badly ] True. Your example suggests that it might be nice to have something other than a cost-delta way of discriminating against seqscans. In principle this consideration could be added to add_path(), although I'm pretty hesitant to make that function even more complex/slower. Perhaps another way would be to generate seqscan paths last (I think they're first at the moment), and only generate them if we didn't find any other path for the rel. Nestloops for join rels have the same issue and would need to be handled similarly, whatever solution we pick. regards, tom lane -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance