Re: Weird indices

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Joseph Shraibman <jks(at)selectacast(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Weird indices
Date: 2001-02-20 02:25:59
Message-ID: Pine.BSF.4.21.0102191820210.85489-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Mon, 19 Feb 2001, Joseph Shraibman wrote:

> > Of course, if the 10113-match estimate is wildly off (as it was in this
> > case), then the wrong plan may be chosen. But it IS NOT CORRECT to
> > suppose that indexscans always beat seqscans. The planner's job would
> > be a lot easier if that were true.
>
> Can't postgres do the index lookup first and find out there are only a
> few tuples that might match?

Well, theoretically the estimate is supposed to match reality. There are
still some cases where there isn't enough information kept to allow that
to be true (the case where there is a single very common non-NULL value is
one such case).

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message adb 2001-02-20 02:32:20 index used when casting to different type?
Previous Message Joseph Shraibman 2001-02-20 02:21:13 Re: Weird indices