From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marc Mitchell <marcm@eisolution.com>
Cc: Robert M. Meyer <rmeyer@installs.com>
Cc: Naomi Walker <nwalker@eldocomp.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Postgres performance slowly gets worse over a month
Date: Wed, 24 Jul 2002 11:21:41 -0400
Message-ID: <11612.1027524101@sss.pgh.pa.us> (raw)
In-Reply-To: <015d01c23281$2ce57380$6f01050a@eisolution.com>
References: <4.2.2.20020723110231.01daf8c0@ecint.ecinet.com>
<1027448992.25561.25.camel@skymaster>
<015d01c23281$2ce57380$6f01050a@eisolution.com>
"Marc Mitchell" <marcm@eisolution.com> writes:
> However, the problem
> was that half the rows in "TABLE_A" had no foreign key relationship and so
> had this field set to zero. No one would ever do a select asking for all
> rows where foreign key = 0 as that didn't make "Business sense". But,
> since the database isn't aware of the business meaning of our data, the
> stats gathered by the ANALYSE would think that the overall distribution of
> the column for a unique value was between 2000 and 3000 rows.
> Our short term fix was to turn down the value of random_page_cost.
> However, as Tom Lane very rightly noted in response to a similar posting,
> this is a total hack. Our goal is to switch to 7.2 in the hopes that the
> "WHERE" extension to the "CREATE INDEX" command coupled with greater
> control of the sample space used in statistics will be the true
> answer.
Actually, 7.2 should fix this without any need for messing with partial
indexes. The new statistics code will realize that zero is an outlier,
and will estimate scans for other target values differently.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, marcm@eisolution.com, rmeyer@installs.com, nwalker@eldocomp.com
Subject: Re: Postgres performance slowly gets worse over a month
In-Reply-To: <11612.1027524101@sss.pgh.pa.us>
References: <4.2.2.20020723110231.01daf8c0@ecint.ecinet.com> <1027448992.25561.25.camel@skymaster> <015d01c23281$2ce57380$6f01050a@eisolution.com> <11612.1027524101@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