Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eANPN-0003Oi-FO for pgsql-general@arkaria.postgresql.org; Thu, 02 Nov 2017 21:52:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eANPM-0007sk-P6 for pgsql-general@arkaria.postgresql.org; Thu, 02 Nov 2017 21:52:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eANMy-0003VP-3F for pgsql-general@postgresql.org; Thu, 02 Nov 2017 21:49:48 +0000 Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1eANMu-0003Hm-OY for pgsql-general@postgresql.org; Thu, 02 Nov 2017 21:49:47 +0000 Received: by mail-io0-x22d.google.com with SMTP id f20so2174484ioj.9 for ; Thu, 02 Nov 2017 14:49:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TVetJ50yKEsP0hGqnpEWJUgDYZGXgFGjkYp4ABJzvpY=; b=PHaAHbg2jlc1pliDWgDBXQWQpsrWysNz+n3xrVinFxShKc5hVSYr5g1FTQ/KxfdYhX +V2ZafQFTomiBveW/8oEZXq8mMRLKh59nXcj+u9dOxZmZh2bpX/AaZETgesel1oE9Qox 1kcn+ivQTqCLnO8e8MP76lzgbMZP9yixQDwmARKR7UhjciRv7ucxwHgoH9WQYa8lAOU8 U4WMInkIokrzVn7za/bc+A1jWsWzcUotGYx9YvR3D1m6YBJS/cLc9xf2nIwwhZEe+Mw5 r8MsZuGjncDazN1RqyetE9j01OditghzMYgCzif110l/VNt3Ry2ptZgav75nlRvsmuTw s9KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=TVetJ50yKEsP0hGqnpEWJUgDYZGXgFGjkYp4ABJzvpY=; b=oXaYlNyiwxPZHtZFj66PaKQiaFtxjQcoyJscESRQkRr1Eb9anxbdzsDMvvAmu7wLud CYD10qKL6EflG/PSUwcjcqiHa9flxYU9nXucU0grDpIgY0MFZWf7LMKqcvuPCycSjX+t wGBLyiTTixarIrmG8p+wvaM3m9QtLTeBJVIXxJwq6AJx5x0BLdSOqotbR6sPa99K4rOj Yh63/hfQ9lRoie3yRIz81/aeHpOrwgsEh3RIePeMzLeFFykUt+QCo4YfWSRrES6BYGCo qOYyblVLrdKKUSpPrIaXYv4XRNM9Nje2liNVBHu8DIgElbj7wKbXqYX84RY98bCP6tcQ rfKw== X-Gm-Message-State: AJaThX4AYsF9lFGcD/XdA1MA1qLl0J8ehAoanu/QBFulcy/RzBMEJsvW R4/xRkEJ9OTqUZvysBXZvrnvsQ== X-Google-Smtp-Source: ABhQp+RdRU96J1iAcGdjrJbhwW2P5/fqBawQ8vQK6CA6zBzoBPouoc8ZmrNGV1qRKFHpXaZshNhECQ== X-Received: by 10.107.200.197 with SMTP id y188mr6237731iof.170.1509659382767; Thu, 02 Nov 2017 14:49:42 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id n132sm310405itn.25.2017.11.02.14.49.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Nov 2017 14:49:42 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 2CCDF800FD3; Thu, 2 Nov 2017 16:49:41 -0500 (CDT) Date: Thu, 2 Nov 2017 16:49:41 -0500 From: Justin Pryzby To: Rhhh Lin Cc: "pgsql-general@postgresql.org" Subject: Re: EXPLAIN command just hangs... Message-ID: <20171102214941.GB2267@telsasoft.com> References: <20171102210228.GA2267@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org 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