Re: EXPLAIN <query> command just hangs...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rhhh Lin <ruanlinehan(at)hotmail(dot)com>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: EXPLAIN <query> command just hangs...
Date: 2017-11-02 21:40:16
Message-ID: 14805.1509658816@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rhhh Lin <ruanlinehan(at)hotmail(dot)com> writes:
> The EXPLAIN <query> statement is currently 'f' for waiting and 'active' via pg_stat_activity, so it is doing something. The ps command does not show me anything more verbose.

ps would confirm for sure whether it was eating CPU time, whereas I do not
particularly trust pg_stat_activity to tell you that.

> 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.

We've seen issues with the planner having trouble trying to determine the
extreme values of an indexed column, in cases where there are a lot of
uncommitted or recently-dead entries at the end of the index --- it does
a lot of work trying to verify the commit status of each entry in turn.
So I wonder if that might apply.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Justin Pryzby 2017-11-02 21:49:41 Re: EXPLAIN <query> command just hangs...
Previous Message Rhhh Lin 2017-11-02 21:13:05 Re: EXPLAIN <query> command just hangs...