Re: indexes are fucked

From: Dr NoName <spamacct11(at)yahoo(dot)com>
To: Ragnar "Hafsta" <gnari(at)simnet(dot)is>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: indexes are fucked
Date: 2005-08-02 17:50:46
Message-ID: 20050802175047.59257.qmail@web31506.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Youngblood 2005-08-02 17:55:22 Re: Slow Inserts on 1 table?
Previous Message Tom Lane 2005-08-02 17:49:46 Re: Problem with dropping a tablespace