Re: speeding up COUNT and DISTINCT queries

Поиск
Список
Период
Сортировка
Искать
От
Josh Berkus
Тема
Re: speeding up COUNT and DISTINCT queries
Дата
Msg-id
200303140910.06416.josh@agliodbs.com
Ответ на
Список
Дерево обсуждения
Re: speeding up COUNT and DISTINCT queries Jean-Luc Lachance <jllachan@nsd.ca>
Max,

> I'm not starting with fresh data every time, I'm usually checking for
> an existing record, then setting a timestamp and a boolean flag.
>
> I've run some profiling and it's about 8000-10,000 UPDATEs every 4
> hours.  These are accompanied by about 800-1000 INSERTs.

If these are wide records (i.e. large text fields or lots of columns ) you may 
want to consider raising your max_fsm_relation in postgresql.conf slightly, 
to about 15,000.

You can get a better idea of a good FSM setting by running VACUUM FULL VERBOSE 
after your next batch (this will lock the database temporarily) and seeing 
how many data pages are "reclaimed", in total, by the vacuum.  Then set your 
FSM to at least that level.

And has anyone mentioned REINDEX on this thread?

-- 
Josh Berkus
Aglio Database Solutions
San Francisco
В списке pgsql-performance по дате отправления
От: Hannu Krosing
Дата:
Сообщение: Re: Postgresql performance
От: Aaron Krowne
Дата:
FAQ