Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNwVM-0000d7-LX for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Mar 2014 03:40:24 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WNwVM-0005OE-4k for pgsql-bugs@arkaria.postgresql.org; Thu, 13 Mar 2014 03:40:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNtvS-0001Ki-Ck for pgsql-bugs@postgresql.org; Thu, 13 Mar 2014 00:55:10 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WNtvK-0004jk-OC for pgsql-bugs@postgresql.org; Thu, 13 Mar 2014 00:55:10 +0000 MIME-Version: 1.0 Subject: BUG #9552: IndexOnlyScan startup_cost>0, why not equal 0?it's a bug? To: pgsql-bugs@postgresql.org From: digoal@126.com Date: Thu, 13 Mar 2014 00:54:29 +0000 Message-ID: <20140313005429.398.2021@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 The following bug has been logged on the website: Bug reference: 9552 Logged by: digoal.zhou Email address: digoal@126.com PostgreSQL version: 9.3.3 Operating system: CentOS 6.4 x64 Description: 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? The TEST below: digoal=# create table t11(id int primary key, info text); CREATE TABLE digoal=# insert into t11 select generate_series(1,100000),'test'; INSERT 0 100000 digoal=# explain select * from t11 where id=1; QUERY PLAN -------------------------------------------------------------------- Index Scan using t11_pkey on t11 (cost=0.29..4.31 rows=1 width=9) Index Cond: (id = 1) (2 rows) digoal=# explain select id from t11 where id=1; QUERY PLAN ------------------------------------------------------------------------- Index Only Scan using t11_pkey on t11 (cost=0.29..4.31 rows=1 width=4) Index Cond: (id = 1) (2 rows) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs