From: Ron Johnson <ron.l.johnson@cox.net>
To: PgSQL Performance ML <pgsql-performance@postgresql.org>
Subject: Re: Odd problem with performance in duplicate database
Date: 11 Aug 2003 17:42:28 -0500
Message-ID: <1060641748.23325.62.camel@haggis> (raw)
In-Reply-To: <200308111503.46794.josh@agliodbs.com>
References: <200308111415.07751.josh@agliodbs.com>
<200308111503.46794.josh@agliodbs.com>
On Mon, 2003-08-11 at 17:03, Josh Berkus wrote:
> Folks,
>
> More followup on this:
>
> The crucial difference between the two execution plans is this clause:
>
> test db has:
> -> Seq Scan on case_clients (cost=0.00..3673.48 rows=11274 width=11) (actual
> time=0.02..302.20 rows=8822 loops=855)
>
> whereas live db has:
> -> Index Scan using idx_caseclients_case on case_clients (cost=0.00..5.10
> rows=1 width=11) (actual time=0.03..0.04 rows=1 loops=471)
>
> using an enable_seqscan = false fixes this, but is obviously not a long-term
> solution.
>
> I've re-created the test system from an immediate copy of the live database,
> and checked that the the main tables and indexes were reproduced faithfully.
>
> Lowering random_page_cost seems to do the trick. But I'm still mystified; why
> would one identical database pick a different plan than its copy?
If the databases are on different machines, maybe the postgres.conf
or pg_hba.conf files are different, and the buffer counts is affect-
ing the optimizer?
--
+---------------------------------------------------------------+
| Ron Johnson, Jr. Home: ron.l.johnson@cox.net |
| Jefferson, LA USA |
| |
| "Man, I'm pretty. Hoo Hah!" |
| Johnny Bravo |
+---------------------------------------------------------------+
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-performance@postgresql.org
Cc: ron.l.johnson@cox.net
Subject: Re: Odd problem with performance in duplicate database
In-Reply-To: <1060641748.23325.62.camel@haggis>
References: <200308111415.07751.josh@agliodbs.com> <200308111503.46794.josh@agliodbs.com> <1060641748.23325.62.camel@haggis>
* 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