Weird performance drop after VACUUM

From: Ümit Öztosun <umit(at)likyabilisim(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Weird performance drop after VACUUM
Date: 2005-08-26 22:04:19
Message-ID: 1125093859.9329.30.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hello,

We are using PostgreSQL for our business application. Recently, during
testing of our application with large volumes of data, we faced a weird
problem. Our query performance dropped *dramatically* after "VACUUM FULL
ANALYZE" command. We have encountered a similar problem listed on
mailing list archives, but the submitter solved his problem by rewriting
his query, which is unfortunatelly very hard for us.

I am attaching two EXPLAIN ANALYZE outputs, first one is just before the
VACUUM FULL ANALYZE command and the other is the one after. Also
attached is the SQL query, which is simplified to clearify the problem.
In the example query time increases from 1.8 second to > 4.0 secons. The
difference for the complete query is much bigger, query time increases
from 7.8 seconds to > 110 seconds.

Any help is appreciated, we were unable to identify what causes the
query planner to choose a different/poor performing plan.

Notes:
Our production platform is Ubuntu Linux Hoary on i386, PostgreSQL 8.0.3,
compiled from sources. Same tests were carried on Windows XP
Professional and PostgreSQL 8.0.1 with similar results. The queries use
little IO, high CPU. The largest table involved in the sample query has
about 10000 rows. Indexes are used intensively, some tables use > 4
indexes.

Best regards,
Umit Oztosun

Attachment Content-Type Size
query.sql text/x-sql 1.5 KB
before_vacuum.txt text/plain 2.8 KB
after_vacuum.txt text/plain 2.5 KB

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Ligesh 2005-08-26 22:45:40 Re: Sending a select to multiple servers.
Previous Message Arjen van der Meijden 2005-08-26 21:16:09 Re: Inefficient queryplan for query with intersectable