Re: vacuum analyze slows sql query - Mailing list pgsql-sql

From Greg Stark
Subject Re: vacuum analyze slows sql query
Date
Msg-id 87breepwn3.fsf@stark.xeocode.com
Whole thread Raw
In response to vacuum analyze slows sql query  (patrick ~ <sidsrr@yahoo.com>)
List pgsql-sql
patrick ~ <sidsrr@yahoo.com> writes:

> I noticed that a freshly created db with freshly inserted data (from
> a previous pg_dump) would result in quite fast results.  However,
> after running 'vacuum analyze' the very same query slowed down about
> 1250x (Time: 1080688.921 ms vs Time: 864.522 ms).

If it gets slower immediately after a single vacuum analyze then the problem
is that one of the queries is getting planned wrong when stats are available.
If it takes a while to slow down then it could be other problems such as index
bloat etc.

Don't use "explain verbose" use "explain analyze". I don't know if it was in
7.1 but you say you reproduced the problem with 7.4. It would be helpful to
see the results of "explain analyze select ..." on the query before and after
the vacuum analyze.

-- 
greg



pgsql-sql by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: vacuum analyze slows sql query
Next
From: sad
Date:
Subject: Re: CREATE TYPE