Re: Query 4-5 times slower after ANALYZE

Поиск
Список
Период
Сортировка
От Gregory Stark
Тема Re: Query 4-5 times slower after ANALYZE
Дата
Msg-id 878wn3f0wd.fsf@oxford.xeocode.com
обсуждение исходный текст
Ответ на Re: Query 4-5 times slower after ANALYZE  (Bill Moran <wmoran@potentialtech.com>)
Список pgsql-general
Bill Moran <wmoran@potentialtech.com> writes:

> I opened one of those links figuring I'd take a few minutes to see if I could
> muster up some advice ... and just started laughing ... definitely not the
> type of query that one can even understand in just a few minutes!

You might consider setting default_statistics_target to 100 and re-analyzing.
The estimates don't look too far off but like Bill I haven't analyzed it very
carefully.

One other things that stands out, using comparisons like
 ('now'::date - creation_date) >= <expression>

is going to make it hard to optimize. Better to use something like
 creation_date <= now() - <expression>

Both because of the now() instead of 'now'::date and because the latter is a
comparison that can be indexed instead of an expression which could use an
index on creation_date.


--
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com
  Ask me about EnterpriseDB's On-Demand Production Tuning

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

Предыдущее
От: Sanjay Arora
Дата:
Сообщение: Re: postgreSQL & amazon ec2 cloud
Следующее
От: tv@fuzzy.cz
Дата:
Сообщение: Re: Query 4-5 times slower after ANALYZE