Re: Identical Queries

Поиск
Список
Период
Сортировка
От Craig A. James
Тема Re: Identical Queries
Дата
Msg-id 45E756A3.5020604@modgraph-usa.com
обсуждение исходный текст
Ответ на Re: Identical Queries  (Rob Schall <rschall@callone.net>)
Список pgsql-performance
Stephan Szabo wrote:
> I tried posting to the bugs, and they said this is a better question for here.
> I have to queries. One runs in about 2 seconds. The other takes upwards
> of 2 minutes. I have a temp table that is created with 2 columns. This
> table is joined with the larger database of call detail records.
> However, these 2 queries are handled very differently.

Even for a temporary table, you should run ANALYZE on it after you fill it but before you query or join to it.  I found
out(the hard way) that a temporary table of just 100 rows will generate dramatically different plans before and after
ANALYZE.

Craig


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

Предыдущее
От: Stephan Szabo
Дата:
Сообщение: Re: Identical Queries
Следующее
От: Tom Lane
Дата:
Сообщение: Re: stats collector process high CPU utilization