Re: insane index scan times - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: insane index scan times
Date
Msg-id 20070603230502.GD3813@alvh.no-ip.org
Whole thread Raw
In response to insane index scan times  (Sergei Shelukhin <realgeek@gmail.com>)
Responses Re: insane index scan times  (Sergei Shelukhin <realgeek@gmail.com>)
List pgsql-general
Sergei Shelukhin escribió:

> 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.

I am not.  You are asking it to give you 12 million rows -- so it does.
What's the surprise if it takes long?

Do you really want to have all 12 million rows as a result?

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: "Alexander Staubo"
Date:
Subject: Re: multimaster
Next
From: Ron Johnson
Date:
Subject: Re: Multiple customers sharing one database?