Re: question about seq scan and index scan

From: Hervé Piedvache <herve(at)elma(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, Sébastien PALLEAU <spalleau(at)elma(dot)fr>, pgsql-general(at)postgresql(dot)org
Subject: Re: question about seq scan and index scan
Date: 2002-10-26 14:53:42
Message-ID: 20021026145633.379F241802@mailer.elma.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Tom,

Le Samedi 26 Octobre 2002 16:31, Tom Lane a écrit :
> =?iso-8859-15?q?Herv=E9=20Piedvache?= <herve(at)elma(dot)fr> writes:
> > Le Vendredi 25 Octobre 2002 20:17, Stephan Szabo a écrit :
> >> Are the estimated number of rows for the scan of a (4379, 3987, and 29)
> >> realistic for mynumber>(23000, 23500, 24000)
> >
> > I'm surpise about this answer for
> >
> >> 23000
> >
> > result is 98
> >
> >> 23350
> >
> > result is 96
> >
> >> 24000
> >
> > result is 93
>
> Hmm, have you "ANALYZE"d this table recently? If so it would be
> interesting to see the pg_stats row for tablea.mynumber.

Every night ...

> If the distribution of mynumber is very uneven, it might be worth
> your while to increase the statistics target for the column, so that
> the planner has more data points with which to make a better estimate.
> See ALTER TABLE SET STATISTICS.

Yep done like this ... I have deleted my index on tablea on mynumber, and put
an alter table set statistics 100 ... and now it's really better !

Many thanks !
--
Hervé Piedvache

Elma Ingénierie Informatique
6 rue du Faubourg Saint-Honoré
F-75008 - Paris - France
Tel. 33-144949901
fax. 33-144949902

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ben 2002-10-26 16:07:08 COMMAND_OK for PL/pgSQL?
Previous Message Tom Lane 2002-10-26 14:31:44 Re: question about seq scan and index scan