Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WO67r-0000Mu-Fo for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Mar 2014 13:56:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WO67q-0007JN-Uf for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Mar 2014 13:56:46 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WO67q-0007IL-3r for pgsql-bugs@postgresql.org; Thu, 13 Mar 2014 13:56:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WO67o-0001HZ-0h for pgsql-bugs@postgresql.org; Thu, 13 Mar 2014 13:56:45 +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 s2DDuZKn014778; Thu, 13 Mar 2014 09:56:36 -0400 From: Tom Lane To: digoal@126.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #9552: IndexOnlyScan startup_cost>0, why not equal 0?it's a bug? In-reply-to: <20140313005429.398.2021@wrigleys.postgresql.org> References: <20140313005429.398.2021@wrigleys.postgresql.org> Comments: In-reply-to digoal@126.com message dated "Thu, 13 Mar 2014 00:54:29 -0000" Date: Thu, 13 Mar 2014 09:56:35 -0400 Message-ID: <14777.1394718995@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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org digoal@126.com writes: > I belive index only scan can return tuple direct, it's not need to scan > heappage, why it's startup_cost equal to index scan? > I'ts a bug? No. Your test case fails to vacuum t11, so although the planner selects an index-only scan, it's still predicting that all the tuples will require heap visits to confirm visibility. The startup cost would not change in any case, since that's about index descent costs not heap visit costs. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs