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.