Re: Analyze makes queries slow...

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Analyze makes queries slow...
Дата
Msg-id 2934.1060616625@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Analyze makes queries slow...  (Stef <svb@ucs.co.za>)
Ответы Re: Analyze makes queries slow...
Список pgsql-performance
Stef <svb@ucs.co.za> writes:
> I have attached an sql statement that normally runs under 3 minutes.
> That is, until I vacuum analyze the database (or just the tables in the query),
> then the same query runs longer than 12 hours, and I have to kill it.

Could we see the results of "EXPLAIN ANALYZE", rather than just EXPLAIN,
for the un-analyzed case?  I won't make you do it for the analyzed case ;-)
but when dealing with a plan-selection problem the planner's estimates
are obviously not to be trusted.

Also, what do you see in pg_stats (after analyzing) for each of the
tables used in the query?

And what PG version is this, exactly?

            regards, tom lane

PS: in case you don't know this already, an easy way to get back to the
un-analyzed state is "DELETE FROM pg_statistics".

В списке pgsql-performance по дате отправления:

Предыдущее
От: Andrew Sullivan
Дата:
Сообщение: Re: Perfomance Tuning
Следующее
От: Stef
Дата:
Сообщение: Re: Analyze makes queries slow...