Re: Yet another "Why won't PostgreSQL use my index?"

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Gregory Wood <gregw(at)com-stock(dot)com>
Cc: PostgreSQL-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Yet another "Why won't PostgreSQL use my index?"
Date: 2002-06-20 22:03:41
Message-ID: 20020620150021.X89987-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 20 Jun 2002, Gregory Wood wrote:

> I guess the best way to approach that particular tuning problem is to find a
> query where the estimated row numbers is close to the actual page numbers
> and then try different values until the random page reads start to become
> slower than the sequential scan. Fun fun.
>
> Of course if PostgreSQL were estimating the number of rows correctly, that
> would be less of a problem. Seems that our data is throwing off the
> statistics... we have some values that appear tens of thousands of times and
> others that appear only a few times, with a few values (such as the example
> I sent) in between. Perhaps it's time to look at TABLE SET STATISTICS...

Yeah. Since the number of the high frequency values is greater than the
number it keeps track of, you're in the same general boat as the earlier
statistics wierdnesses. It's really easy to play with the set statistics
though. :)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-06-20 22:13:33 Re: foreign Key problem
Previous Message Varun Kacholia 2002-06-20 21:56:23 Re: Highly obscure and erratic