Re: seqscan instead of index scan - Mailing list pgsql-performance

From Stephan Szabo
Subject Re: seqscan instead of index scan
Date
Msg-id 20040830130016.T98089@megazone.bigpanda.com
Whole thread Raw
In response to Re: seqscan instead of index scan  (Martin Sarsale <martin@emepe3.net>)
List pgsql-performance
On Mon, 30 Aug 2004, Martin Sarsale wrote:

> On Mon, 2004-08-30 at 15:06, Merlin Moncure wrote:
> > create function is_somethingable (ctype, dtype) returns boolean as
>
> Thanks, but I would prefer a simpler solution.
>
> I would like to know why this uses a seqscan instead of an index scan:
>
> create index t_idx on t((c+d));
> select * from t where c+d > 0;

As a geuss, since 7.4 and earlier have no statistics on the distribution
of c+d it has to guess about how likely that is to be true and is probably
overestimating. 8.0beta might handle this better.

pgsql-performance by date:

Previous
From: Pierre-Frédéric Caillaud
Date:
Subject: Re: seqscan instead of index scan
Next
From: Greg Stark
Date:
Subject: Re: Why does a simple query not use an obvious index?