Re: Select count(*) on a 2B Rows Tables Takes ~20 Hours

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: Select count(*) on a 2B Rows Tables Takes ~20 Hours
Дата
Msg-id 20180913180532.GD11702@telsasoft.com
обсуждение исходный текст
Ответ на Select count(*) on a 2B Rows Tables Takes ~20 Hours  (Fd Habash <fmhabash@gmail.com>)
Список pgsql-performance
On Thu, Sep 13, 2018 at 01:33:54PM -0400, Fd Habash wrote:
> Is this ET expected? If not, what could be slowing it down? I’m currently running explain analyze and I’ll share the
finaloutput when done. 
 

explain(analyze,BUFFERS) is what's probably interesting

You're getting an index-only-scan, but maybe still making many accesses to the
heap (table) for pages which aren't all-visible.  You can maybe improve by
vacuuming (perhaps by daily cronjob or by ALTER TABLE SET autovacuum threshold
or scale factor).

-- 
Justin Pryzby
System Administrator
Telsasoft
+1-952-707-8581


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

Предыдущее
От: Fd Habash
Дата:
Сообщение: Select count(*) on a 2B Rows Tables Takes ~20 Hours
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Select count(*) on a 2B Rows Tables Takes ~20 Hours