Re: [GENERAL] EXPLAIN command just hangs...

Поиск
Список
Период
Сортировка
От Justin Pryzby
Тема Re: [GENERAL] EXPLAIN command just hangs...
Дата
Msg-id 20171102214941.GB2267@telsasoft.com
обсуждение исходный текст
Ответ на Re: [GENERAL] EXPLAIN command just hangs...  (Rhhh Lin <ruanlinehan@hotmail.com>)
Ответы Re: [GENERAL] EXPLAIN command just hangs...
Список pgsql-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

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [GENERAL] EXPLAIN command just hangs...
Следующее
От: tao tony
Дата:
Сообщение: [GENERAL] checkpoint and recovering process use too much memory