Re: indexes are fucked

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: Dr NoName <spamacct11(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: indexes are fucked
Date: 2005-08-02 17:37:45
Message-ID: 1123004265.19874.23.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2005-08-02 at 10:04 -0700, Dr NoName wrote:

> I got another problem with postgres. This time it
> refuses to use the indexes. Check this out:

[snip]

> siam_production=> explain SELECT render.* FROM render
> WHERE person_id = 432;
> QUERY PLAN
> -----------------------------------------------------------------
> Seq Scan on render (cost=0.00..39014.72 rows=27833
> width=1493)
> Filter: (person_id = 432)

An explain analyze would be more informative, with and without
seqscan enabled.
What proportion of rows have this particular value of person_id?
Maybe you need to increase statistics target of the column.

What is the output of these:

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

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

select count(*) from render;

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

gnari

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Siegmar 2005-08-02 17:42:57 Re: Problem with dropping a tablespace
Previous Message Scott Marlowe 2005-08-02 17:37:04 Re: indexes are farked