From: Justin Pryzby <pryzby@telsasoft.com>
To: Fd Habash <fmhabash@gmail.com>
Cc: pgsql-performance@lists.postgresql.org <pgsql-performance@lists.postgresql.org>
Subject: Re: Select count(*) on a 2B Rows Tables Takes ~20 Hours
Date: Thu, 13 Sep 2018 13:05:32 -0500
Message-ID: <20180913180532.GD11702@telsasoft.com> (raw)
In-Reply-To: <5b9a9f81.1c69fb81.43388.0e8b@mx.google.com>
References: <5b9a9f81.1c69fb81.43388.0e8b@mx.google.com>
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 final output 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: pryzby@telsasoft.com, fmhabash@gmail.com, pgsql-performance@lists.postgresql.org
Subject: Re: Select count(*) on a 2B Rows Tables Takes ~20 Hours
In-Reply-To: <20180913180532.GD11702@telsasoft.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox