Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fO27B-0001c5-U7 for pgsql-general@arkaria.postgresql.org; Wed, 30 May 2018 14:30:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fO276-0005ET-Bv for pgsql-general@arkaria.postgresql.org; Wed, 30 May 2018 14:30:08 +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.89) (envelope-from ) id 1fO274-0005Dw-Uh for pgsql-general@lists.postgresql.org; Wed, 30 May 2018 14:30:08 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fO26z-000238-06 for pgsql-general@lists.postgresql.org; Wed, 30 May 2018 14:30:05 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5BC0F21CB8; Wed, 30 May 2018 10:29:58 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 30 May 2018 10:29:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=53KtMBGJ3kcaFTdjlqObvjiyksDK8 UJdzO7n7xqJEqI=; b=dVWZNTECLZUpCpEE+tGxl/UCGGqVZwHOvpQ1z7kbC9IMU sCX8Yn8tGNxZmUB2YNxLwc2DeEU/xAYYp9LYW6R29ntnXejavQN163DChvG/VYwY WY2gZbgBKxyzrCo7zf+hnNs+aZRWrnEtjwbAjpq+jMGWKTLNEeP9n8s06SUFs1V5 AAFcZTYBhnLsbj2KRIQz83I84K0FpIvAnR/gZi71wrn5BLB3NcgZUYF4lUOUx61p yfjP/KJYRr4l6OLEwiZzAFLb2BxVuvjVvbpNOJ54LSVeSzqFrHvmvF4Hzx18B91d NcNOGBpX8jHPIv0KQclEdwsAroZY+uUyAVyQYrMhQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=53KtMB GJ3kcaFTdjlqObvjiyksDK8UJdzO7n7xqJEqI=; b=OuwWPesA4QBtNAbHcq/5y1 D02e+D4AERRx5kvUZ62O2CuhOoRWa5R/y+hNMA0Fqq35tSuBJOHdMxEVvjexvInY U13ExEob8xPOoZue4AQ1v3pH8yNg8sMwAKA+p+F7sY4gW9DkXufaY/Xp7K18kowC cFvA5aElhX3rUyAIedDml/guOYsF95QVxkMF0fUyYyhLhAHj+RiklXbCf26w/2o8 uN6rZZ4tAOnH4uH1sO8gU7BVadPrsIGXrnKFwZC72pm6KP6i8tKdhQhPLMicJRfC cQCw+160JCZlCCFunIC/PnKm4nR9bb8iZCuJMydx3bjcQXff/OC5EEDkklR8o9pw == X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Proxy: X-ME-Sender: Received: from [192.168.1.3] (unknown [71.212.159.209]) by mail.messagingengine.com (Postfix) with ESMTPA id C0A921028C; Wed, 30 May 2018 10:29:57 -0400 (EDT) Subject: Re: Query running for 12 hours To: =?UTF-8?Q?Yavuz_Selim_Serto=c4=9flu?= Cc: pgsql-general@lists.postgresql.org References: <56911e4e-d8a7-1770-7f6b-cd2104979693@aklaver.com> <7c2c3680-49a7-e6ce-82e1-171ba3e6db43@aklaver.com> From: Adrian Klaver Message-ID: Date: Wed, 30 May 2018 07:29:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 05/30/2018 07:19 AM, Yavuz Selim Sertoğlu wrote: > > > 2018-05-30 17:02 GMT+03:00 Adrian Klaver >: > > On 05/30/2018 06:54 AM, Yavuz Selim Sertoğlu wrote: > > I am just a regular dba so I dont know what's sent from > application exactly but I assume now()-1 week. > In the log file, there are two more same queries. And their > value is *2018-05-23 02:00:00* > > And these queries are not showing up in pg_stat_activity as still > active? > > *>> I think these were completed so they are not in pg_stat_activity.* Remaining suggestions/questions: 1) If it still exists look in Postgres log around 2018-05-30 02:00:00, the time the problematic queries started, to see if there are any entries of note. 2) You are on Postgres 9.5.3 and the most recent release 9.5.13. There have been a lot of bug fixes in the interim and it would be a good idea to upgrade. It is minor release upgrade but I would go through the release notes first: https://www.postgresql.org/docs/9.5/static/release.html as there some thing that might require your action. 3) I suggest 2) because a quick scan of the release notes found this: https://www.postgresql.org/docs/9.5/static/release-9-5-11.html " Cope with failure to start a parallel worker process (Amit Kapila, Robert Haas) Parallel query previously tended to hang indefinitely if a worker could not be started, as the result of fork() failure or other low-probability problems. " Is it possible that parallel query: https://www.postgresql.org/docs/10/static/when-can-parallel-query-be-used.html is in use? > > > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > > -- Adrian Klaver adrian.klaver@aklaver.com