Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YTvuH-0002MX-Hp for pgsql-performance@arkaria.postgresql.org; Fri, 06 Mar 2015 17:19:25 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YTvuG-0006Jr-M5 for pgsql-performance@arkaria.postgresql.org; Fri, 06 Mar 2015 17:19:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YTvuF-0006Jk-3o for pgsql-performance@postgresql.org; Fri, 06 Mar 2015 17:19:23 +0000 Received: from mail-we0-f179.google.com ([74.125.82.179]) by magus.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1YTvu5-0007Xm-QA for pgsql-performance@postgresql.org; Fri, 06 Mar 2015 17:19:21 +0000 Received: by wesx3 with SMTP id x3so7417477wes.1 for ; Fri, 06 Mar 2015 09:19:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:organization:user-agent :mime-version:to:cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=as2HvHodZxGVT0Eq1q/RlSHRXfGKxRqOrX7GnaquhA8=; b=fSyyyBsZa2DfPK+kNEFpPPY7I7yOjU/R6L92MK4zlWpFnuJc/uizK6hEFlMp/ODwC9 vLhp6gosBX6X+LBxrYeJp/NzCIGqGB5DIwhhlXrht75jTW5tZAHWDE/rFFN9RbIZ6KHj vJc032QruvaX1YNs57Uh6QHZJZk2nD6j4YwZ2YoGx/A5vvTUDfVhVhThRdTfM40LkYLa 3jr0uE6XVIUTk7P8itEKdgdC2KMz0niZxcAchlzmx07vbx+CQwebaawSkEXtxGtbEZ20 x2hRMTxFYoJ/klYwmameeytVs+7F47xXzDC5cMWngU4lK13jrYSFBL8uhPegOajhYl9d +L2Q== X-Gm-Message-State: ALoCoQmfOUCAMCnrJ9Vo80ATvbLEjyQiWyj13XFf06Oa3bi80lE/AWZk/gGJXOl4nhwt3aBXDOr1 X-Received: by 10.194.158.234 with SMTP id wx10mr32073764wjb.23.1425662351474; Fri, 06 Mar 2015 09:19:11 -0800 (PST) Received: from [192.168.1.163] (ip-78-45-139-138.net.upcbroadband.cz. [78.45.139.138]) by mx.google.com with ESMTPSA id j5sm3099842wie.3.2015.03.06.09.19.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Mar 2015 09:19:10 -0800 (PST) Message-ID: <54F9E179.4000804@2ndquadrant.com> Date: Fri, 06 Mar 2015 18:18:49 +0100 From: Tomas Vondra Organization: 2ndQuadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Tom Lane CC: pgsql-performance@postgresql.org, Gunnlaugur Thor Briem Subject: Re: EXPLAIN (no ANALYZE) taking an hour for INSERT FROM SELECT References: <54F8F2BB.2010402@2ndquadrant.com> <6068.1425602694@sss.pgh.pa.us> In-Reply-To: <6068.1425602694@sss.pgh.pa.us> Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-performance Precedence: bulk Sender: pgsql-performance-owner@postgresql.org On 6.3.2015 01:44, Tom Lane wrote: > Tomas Vondra writes: >> On 5.3.2015 16:01, Gunnlaugur Thor Briem wrote: >>> - postgres version is 9.1.13 > >> The only thing I can think of is some sort of memory exhaustion, >> resulting in swapping out large amounts of memory. > > I'm wondering about the issue addressed by commit fccebe421 ("Use > SnapshotDirty rather than an active snapshot to probe index > endpoints"). Now, that was allegedly fixed in 9.1.13 ... but if the > OP were confused and this server were running, say, 9.1.12, that > could be a viable explanation. Another possibly viable explanation > for seeing the issue in 9.1.13 would be if I fat-fingered the > back-patch somehow :-(. How would fccebe421 explain the large amount of random writes (~4MB/s for more than an hour), reported in the initial post? And why would that only affect the EXPLAIN and not the bare query? I guess there might be two sessions, one keeping uncommitted changes (thus invisible tuples), and the other one doing the explain. And the actual query might be executed after the first session does a commit. But the random writes don't really match in this scenario ... regards -- Tomas Vondra http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-performance