pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone.bigpanda.com>
To: Martin Sarsale <martin@emepe3.net>
Cc: pgsql-performance@postgresql.org
Subject: Re: seqscan instead of index scan
Date: Mon, 30 Aug 2004 13:04:00 -0700 (PDT)
Message-ID: <20040830130016.T98089@megazone.bigpanda.com> (raw)
In-Reply-To: <1093889849.1680.83.camel@kadaif>
References: <6EE64EF3AB31D5448D0007DD34EEB3412A748D@Herge.rcsinc.local>
	<1093889849.1680.83.camel@kadaif>

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.



view thread (14+ messages)  latest in thread

Message-ID: <20040830130016.T98089@megazone.bigpanda.com>
Permalink:  ../20040830130016.T98089@megazone.bigpanda.com/
Also on:    postgresql.org/message-id/20040830130016.T98089@megazone.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sszabo@megazone.bigpanda.com, martin@emepe3.net
  Subject: Re: seqscan instead of index scan
  In-Reply-To: <20040830130016.T98089@megazone.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox