Re: Functional Indices - Mailing list pgsql-general

From mordicus
Subject Re: Functional Indices
Date
Msg-id 9eei5r$2s4s$1@news.tht.net
Whole thread Raw
In response to Re: Functional Indices  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Responses Re: Re: Functional Indices  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Stephan Szabo wrote:
>> explain select * from titles where lower(title) = 'monde';
>> Seq Scan on titles  (cost=0.00..39392.10 rows=14145 width=44)
>
> How many rows are in titles?  It seems to estimate 14000+
> rows are going to match.  If that's true, sequence scan may
> be a better plan than the index.  Or, perhaps, do you have
> a very common title value that's throwing off the statistics?
>
Hello,

register=# select count(title) from titles;
  count
---------
 1414473
(1 row)

I have solved the probleme by setting enable_seqscan to false and now it
use index, but i don't understand why it choose to do a seq scan.

thanks
Bojnourdi Kaikavous


pgsql-general by date:

Previous
From: Rene Pijlman
Date:
Subject: Re: UPDATE keyword
Next
From: "Len Morgan"
Date:
Subject: Re: Postgres performance issue