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 1fO1nO-0006la-4i for pgsql-general@arkaria.postgresql.org; Wed, 30 May 2018 14:09:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fO1nM-0006rp-Qf for pgsql-general@arkaria.postgresql.org; Wed, 30 May 2018 14:09:44 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fO1nM-0006rf-En for pgsql-general@lists.postgresql.org; Wed, 30 May 2018 14:09:44 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fO1nI-0005aV-Sv for pgsql-general@lists.postgresql.org; Wed, 30 May 2018 14:09:42 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1C70521607; Wed, 30 May 2018 10:09:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 30 May 2018 10:09:40 -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=lQFcIGu8BqsrRwyfI5A/R7DftT5g6 8yjKhPlaG+HuRk=; b=XUx1lL8Uc/yG4Idtbbc3R/lmrNrJ7gptGawGmy5YNEKr/ gUp/iZZ8w7930iHm+ehw5slMA8+MiopVj5zN770TArbPCl0PUPMk5iFgNOmFUnkO ocrsg7ArjIk5VWeDg4FEgp31SzsJMk47QhG6oWAly3ZQbCMCRKHSRJQFCCFuRaZy f5yaXjvEd/7Oei1cdcGujGGLAZ+GUF1A1ff7uPNxq/BDPGWknZMNMWZzTxCOfCFf f+jLt9kSuGEkPe2Tz/b0l1oT8ln/HaRx7NumE57YgO15kFH+D1cPTR+289LPz/76 khfuPL0u57U5ozzi+f7NtS2pmcT8b5jDTYUj4TdKg== 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=lQFcIG u8BqsrRwyfI5A/R7DftT5g68yjKhPlaG+HuRk=; b=F9n5b8YiuGbXKFr/I+NJCd sWiknrugf8gP3TW0Yz/iJpVTP+iM3WFVdpgeX56JHj7jY1+cqs5aNhuwMB16GhJX zrf45cHRYpLidU6K21c+eBOFHoTKSR6ePcN/nIhq/ZN5pEwp99IiXV1xpBj7T07g fmT2l4EWBmlec+PJ7uKG81ZEWwI2/vzru8yzzDbiONLQ8oLXKeYGWlmWi2VcjoQP N0LtLiWfq+SmDX8vbgOiXeb5uU4EPo4s81j+M4NQLjQFsrW6EI3FD1YzNg3oH/Hm Ghp/4/5oEzTP0bd2uiDZGdRPYRIF7Vf4Q51zA410SwQhF4a6BzEFNMn7XhhIB7pw == 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 6AA3D10266; Wed, 30 May 2018 10:09:39 -0400 (EDT) Subject: Re: Query running for 12 hours To: Melvin Davidson , =?UTF-8?Q?Yavuz_Selim_Serto=c4=9flu?= Cc: "pgsql-generallists.postgresql.org" References: <56911e4e-d8a7-1770-7f6b-cd2104979693@aklaver.com> From: Adrian Klaver Message-ID: <2b9d5e83-0acb-09b9-8bb4-c44a82579996@aklaver.com> Date: Wed, 30 May 2018 07:09:38 -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:00 AM, Melvin Davidson wrote: > > > > T*wo things: > * > *From your explain, it looks like you need an index on this_.tarih, > since it is doing a sequential scan when it should be using an index.* > * > * > *Also, your main problem is that when you have two exact same queries > executing at the same time, they will cause contention in* > *the disk, and neither one will make much progress. I am having a hard time seeing how two SELECT queries that on average take ~6 secs each can stay in contention for 12+ hours, especially with: waiting | f > * > > -- > *Melvin Davidson** > Maj. Database & Exploration Specialist** > Universe Exploration Command – UXC*** > Employment by invitation only! -- Adrian Klaver adrian.klaver@aklaver.com