insane index scan times - Mailing list pgsql-general

From Sergei Shelukhin
Subject insane index scan times
Date
Msg-id 1180807698.113654.264440@w5g2000hsg.googlegroups.com
Whole thread Raw
Responses Re: insane index scan times  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-general
Create table entries (id bigint primary key, somedata varchar(500));
/* insert ~12mil rows of data, somedata mostly empty */

create table stuff (id bigint, bah int, primary key (id, bah));

insert into stuff (id,bah) select id, 1 from entries;

create index blah on stuff(id);

vacuum full analyze;

set enable_seqscan = on;

explain select * from entries inner join stuff on entries.id =
stuff.id;

 ->  Seq Scan on stuff  (cost=0.00..193344.00 rows=12550400 width=12)


set enable_seqscan = off;

explain select * from entries inner join stuff on entries.id =
stuff.id;

 ->  Index Scan using blah on stuff  (cost=0.00..25406232.30
rows=12550400 width=12)

Query execution resuls are consistent w/explain. wtf? no I mean,
WTF?????!!!!!!!!!!!!!!!!!!!

Sorry. But I 'm amazed.


pgsql-general by date:

Previous
From: Lew
Date:
Subject: Re: There can be only one! How to avoid the "highlander-problem".
Next
From: "richyen3@gmail.com"
Date:
Subject: Re: autovacuum vacuums entire database...is this right?