Re: vacuum analyze slows sql query

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: vacuum analyze slows sql query
Дата
Msg-id 87breepwn3.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на vacuum analyze slows sql query  (patrick ~ <sidsrr@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: vacuum analyze slows sql query
Следующее
От: sad
Дата:
Сообщение: Re: CREATE TYPE