Re: indexes are fucked

Поиск
Список
Период
Сортировка
От Dr NoName
Тема Re: indexes are fucked
Дата
Msg-id 20050802175047.59257.qmail@web31506.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: indexes are fucked  (Ragnar Hafstað <gnari@simnet.is>)
Ответы Re: indexes are fucked  (Ragnar Hafstað <gnari@simnet.is>)
Список 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 по дате отправления:

Предыдущее
От: Peter Wilson
Дата:
Сообщение: Re: feeding big script to psql
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Problem with dropping a tablespace