From: Justin Pryzby <pryzby@telsasoft.com>
To: Rhhh Lin <ruanlinehan@hotmail.com>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: EXPLAIN <query> command just hangs...
Date: Thu, 2 Nov 2017 16:49:41 -0500
Message-ID: <20171102214941.GB2267@telsasoft.com> (raw)
In-Reply-To: <DB6PR1001MB11419068A9E3CC94B5A29FF0AE5C0@DB6PR1001MB1141.EURPRD10.PROD.OUTLOOK.COM>
References: <DB6PR1001MB1141C4DADE28C72A27D70D78AE5C0@DB6PR1001MB1141.EURPRD10.PROD.OUTLOOK.COM>
<20171102210228.GA2267@telsasoft.com>
<DB6PR1001MB11419068A9E3CC94B5A29FF0AE5C0@DB6PR1001MB1141.EURPRD10.PROD.OUTLOOK.COM>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-general>
On Thu, Nov 02, 2017 at 09:13:05PM +0000, Rhhh Lin wrote:
> Yes, it may be an issue with the index, but I'd like to have some evidence
> towards that before dropping and recreating (It does not appear that bloat is
> a problem here or dead tuples either).
Why do you say those aren't an issue? Just curious.
Have you vacuum or reindexed (or pg_repack) ?
How large are the table and index? \dt+ and \di+
> The reason I am very suspect of the timestamp column makeup is that if I
> remove that predicate from the EXPLAIN command and the actual query, both
> complete within seconds without issue. So I do know where the issue is (I
> just dont know what the issue is!).
It could be that you're hitting selfuncs.c:get_actual_variable_range() and the
extremes of the index point to many dead tuples (as I see Tom suggests).
You could strace the backend and see if it's reading (or writing??)
consecutively (hopefully with ample OS readahead) or randomly (without).
Justin
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: pryzby@telsasoft.com, ruanlinehan@hotmail.com
Subject: Re: EXPLAIN <query> command just hangs...
In-Reply-To: <20171102214941.GB2267@telsasoft.com>
References: <DB6PR1001MB1141C4DADE28C72A27D70D78AE5C0@DB6PR1001MB1141.EURPRD10.PROD.OUTLOOK.COM> <20171102210228.GA2267@telsasoft.com> <DB6PR1001MB11419068A9E3CC94B5A29FF0AE5C0@DB6PR1001MB1141.EURPRD10.PROD.OUTLOOK.COM> <20171102214941.GB2267@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