Re: indexes are fucked - Mailing list pgsql-general

From Dr NoName
Subject Re: indexes are fucked
Date
Msg-id 20050802175047.59257.qmail@web31506.mail.mud.yahoo.com
Whole thread Raw
In response to Re: indexes are fucked  (Ragnar Hafstað <gnari@simnet.is>)
Responses Re: indexes are fucked  (Ragnar Hafstað <gnari@simnet.is>)
List pgsql-general
> What is the output of these:
>
> set enable_seqscan = off;
> explain SELECT render.* FROM render WHERE person_id
> = 432;


         QUERY PLAN

-------------------------------------------------------------------------------------------------------------------------------------------
 Index Scan using render_person_id_idx on render
(cost=0.00..108735.88 rows=27833 width=1493) (actual
time=0.11..77.62 rows=5261 loops=1)
   Index Cond: (person_id = 432)
 Total runtime: 80.99 msec
(3 rows)


so it will use the index if I disable seq scan? wtf?


> set enable_seqscan = on;
> explain SELECT render.* FROM render WHERE person_id
> = 432;


QUERY PLAN
--------------------------------------------------------------------------------------------------------------
 Seq Scan on render  (cost=0.00..39014.72 rows=27833
width=1493) (actual time=7.11..743.55 rows=5261
loops=1)
   Filter: (person_id = 432)
 Total runtime: 747.42 msec
(3 rows)



> select count(*) from render;

 count
--------
 236612
(1 row)



> select count(*) from render WHERE person_id = 432;

 count
-------
  5261
(1 row)


thanks,

Eugene

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

pgsql-general by date:

Previous
From: Peter Wilson
Date:
Subject: Re: feeding big script to psql
Next
From: Tom Lane
Date:
Subject: Re: Problem with dropping a tablespace