Odd problem with performance in duplicate database

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Odd problem with performance in duplicate database
Date: 2003-08-11 21:15:07
Message-ID: 200308111415.07751.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Folks:

I have a live and a test database for an in-production system running on
7.2.4.

The test database is a copy of the live one. They are running on the same
copy of Postgres, on the same server. I use the test database to test
changes before I apply them to the production system. Periodically (like
today) I reload the test system from the backup of the live one.

I'm now having a problem with a huge complex query which runs very slowly on
the test database, but very quickly on the live database! The problems
seems to be that the test database seems to think that a nested loop is an
appropriate strategy for a table of 140,000 records, while the live one
realizes that it's not.

What really has me scratching my head is that the test database is an exact
copy of the live database, just a few hours older. And the live database has
never displayed this performance problem, whereas the test database has had
it for 2-3 weeks.

Both EXPLAIN ANALYZEs are attached.

--
-Josh Berkus
Aglio Database Solutions
San Francisco

Attachment Content-Type Size
perf_prob_live.txt text/plain 11.1 KB
perf_prob_test.txt text/plain 11.4 KB

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Bruce Momjian 2003-08-11 21:45:55 Re: Windows on SuSE? 7.4
Previous Message Robert Treat 2003-08-11 18:53:12 Re: Windows on SuSE? 7.4