From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Witham <davidw@unidial.com.au>
Cc: pgsql-sql@postgresql.org
Subject: Re: Indexes and statistics
Date: Wed, 18 Feb 2004 00:10:05 -0500
Message-ID: <20690.1077081005@sss.pgh.pa.us> (raw)
In-Reply-To: <CFA248776934FD43847E740E43C346D199DC13@ozimelb03.ozicom.com>
References: <CFA248776934FD43847E740E43C346D199DC13@ozimelb03.ozicom.com>
"David Witham" <davidw@unidial.com.au> writes:
> One of the customers is quite large (8.3% of the records):
Hmm. Unless your rows are quite wide, a random sampling of 8.3% of the
table would be expected to visit every page of the table, probably
several times. So the planner's cost estimates do not seem out of line
to me; an indexscan *should* be slow. The first question to ask is why
the deviation from reality. Are the rows for that customer ID likely to
be physically concentrated into a limited number of physical pages?
Do you have so much RAM that the whole table got swapped in, eliminating
the extra I/O that the planner is expecting?
regards, tom lane
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-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, davidw@unidial.com.au
Subject: Re: Indexes and statistics
In-Reply-To: <20690.1077081005@sss.pgh.pa.us>
* 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