Search Postgresql Archives

insane index scan times

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux