Re: Screwy Statistics...

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Glen Parker <glenebob(at)nwlink(dot)com>
Cc: Pg-General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Screwy Statistics...
Date: 2002-09-06 22:35:50
Message-ID: 20020906152810.T83345-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 6 Sep 2002, Glen Parker wrote:

> Second, if the planner believes it will find 6700 rows in a
> 35000 row table, shouldn't it choose an index? I have a
> unique index on "branch". What percentage of expected
> rows/possible rows is the usual cutoff, anyone know?
> Whatever it is, it seems too low to me.

Do an explain analyze and set enable_seqscan=off
and see which runs faster which is pretty much the only
way to be sure, but if there's no clustering,
6700 rows of 35000 rows with an expected width of 520
probably touches close to every page in the heap file any
way (figure that there's about 2-3k pages barring
dead tuples or such).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2002-09-06 22:44:15 Re: Surprise :-(
Previous Message Glen Parker 2002-09-06 22:31:30 Slow query when joining to un-analyzed temp table...