Re: Functional Indices

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: kavoos <kavoos(at)issn(dot)org>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Functional Indices
Date: 2001-05-22 19:43:02
Message-ID: Pine.LNX.4.30.0105222139510.757-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

kavoos writes:

> create index lower_title on titles (lower(title));
> vacuum analyze;
> ...
> explain select * from titles where lower(title) = 'monde';
> Seq Scan on titles (cost=0.00..39392.10 rows=14145 width=44)
>
> Why it does not use the index ?

The planner estimates that this query returns 14145 rows. If this is more
than a small fraction of the rows in this table then a sequential scan is
better than an index scan.

The questions are, how many rows does this query really return, and how
many rows are in this table. Btw., this is discussed in the manual under
performance tips.

--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jason Earl 2001-05-22 19:48:55 Re: Re: perl vs php for postgresql
Previous Message Stephan Szabo 2001-05-22 19:29:28 Re: Functional Indices