Re: Too slow querying a table of 15 million records

Поиск
Список
Период
Сортировка
От Tobias Brox
Тема Re: Too slow querying a table of 15 million records
Дата
Msg-id 20050628060333.GH7652@tobias.exoweb.net
обсуждение исходный текст
Ответ на Too slow querying a table of 15 million records  (kjelle@bingon.no)
Ответы Re: Too slow querying a table of 15 million records  (John A Meinel <john@arbash-meinel.com>)
Список pgsql-performance
[kjelle@bingon.no - Tue at 08:33:58PM +0200]
> I use FreeBSD 4.11 with PostGreSQL 7.3.8.
(...)
> database=> explain select date_trunc('hour', time),count(*) as total from
> test where p1=53 and time > now() - interval '24 hours' group by
> date_trunc order by date_trunc ;

I haven't looked through all your email yet, but this phenomena have been up
at the list a couple of times.  Try replacing "now() - interval '24 hours'"
with a fixed time stamp, and see if it helps.

pg7 will plan the query without knowledge of what "now() - interval '24
hours'" will compute to.  This should be fixed in pg8.

--
Tobias Brox, +86-13521622905
Nordicbet, IT dept

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

Предыдущее
От: Colin Taylor
Дата:
Сообщение: slow simple update?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: How are text columns stored?