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 1fO1g4-0006K3-Jk for pgsql-general@arkaria.postgresql.org; Wed, 30 May 2018 14:02:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fO1g3-0000LD-A1 for pgsql-general@arkaria.postgresql.org; Wed, 30 May 2018 14:02:11 +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 1fO1g2-0000Ks-Pv for pgsql-general@lists.postgresql.org; Wed, 30 May 2018 14:02:11 +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 1fO1fz-0001SJ-J2 for pgsql-general@lists.postgresql.org; Wed, 30 May 2018 14:02:10 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 6932B219DD; Wed, 30 May 2018 10:02:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 30 May 2018 10:02:06 -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=5iwolKA3w8KdartKOyCke1NdAKImc W6qlAugnq144qs=; b=sVNYidKjVr6d446txmVLCga+8nlDraVSfOXQvAMz/+8k8 FjLQv3WYT0J5oWikwgcyLqqb1tWcPWNXiTGJF1Y4+kI0DYe9MJni+4oxe5CS5uEV 9uycVvhbgZKvgeACVkOCUK2YHIhgdFnd+wwbOcZ631OGou9zTqC0plq3q0cn85Ye Qjyh/whZO2HKhORJPBPgvoHPpTrxnMseLvysCtS5OxOKfVgvm9VscUoOAVDHjp/o 9BCbNokFZ+0vkh5HckYyaF/D3oBhSMPPl7sxDFkukphDwKNVNkdTsjCUduUo3R75 NsFSL+HydktLGEcip9Nm3Er85IuCi3nAsMtPaoF8g== 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=5iwolK A3w8KdartKOyCke1NdAKImcW6qlAugnq144qs=; b=VpxiVHF6a8xpZ4ZxlqKNfY 137tzS60tzazFi/1dDViagFloTJ5TX/YXx86H3FJAXi7DGF3UqvO87uz08jHOw8h vZHcPaX1nM51aXNcaUAnEqTOqXcaBVfFO+ZtztVwquSJbLReH15VfLDJxBlrOiqQ 7Y0kzpfeZeoj813RrVcfXbC6sGl/rBiEhUgFJVgEFdOmcmsEMN53hW02LLyZ8XjH H5aIZAPN2rTS5MHbBswAFQTt8xiTRxUMNig03noiCd0/0+5RPmtbrcN09Z+fpFBV X4unkkMuaH4V5W9iokBwTck64jXWqMDvX5b838ybqb350uNdPfadm3Vxxdiz+AGg == 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 B3C4C1025C; Wed, 30 May 2018 10:02:05 -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> From: Adrian Klaver Message-ID: <7c2c3680-49a7-e6ce-82e1-171ba3e6db43@aklaver.com> Date: Wed, 30 May 2018 07:02:04 -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 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 explain analyzed same query with that value and its completed in 6 > seconds.* > ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > --------------------------------------------------------------------------------------------------------------- >  Hash Left Join  (cost=388.90..60022.26 rows=1165585 width=503) (actual > time=34.951..4338.432 rows=1167885 loops=1) >    Output: this_.id, this_.islemturu, this_.kullanici_id, > this_.loglananislem, this_.oncekiveri, this_.tarih, this_.veri, > kullanici2_.id, kullanici2_.ad, kullanici2_.aktif, kullanici2_.dbuser, kull > anici2_.eposta, kullanici2_.kullaniciadi, kullanici2_.kullanicitipienum, > kullanici2_.parola, kullanici2_.soyad >    Hash Cond: (this_.kullanici_id = kullanici2_.id) >    Buffers: shared hit=29227 >    ->  Seq Scan on public.t_log_kaydi this_  (cost=0.00..43626.00 > rows=1165585 width=374) (actual time=0.010..1611.388 rows=1167885 loops=1) >          Output: this_.id, this_.islemturu, this_.loglananislem, > this_.oncekiveri, this_.tarih, this_.veri, this_.kullanici_id >          Filter: (this_.tarih < '2018-05-23 02:00:00.023'::timestamp > without time zone) >          Rows Removed by Filter: 3178 >          Buffers: shared hit=29034 >    ->  Hash  (cost=278.40..278.40 rows=8840 width=129) (actual > time=34.770..34.770 rows=9134 loops=1) >          Output: kullanici2_.id, kullanici2_.ad, kullanici2_.aktif, > kullanici2_.dbuser, kullanici2_.eposta, kullanici2_.kullaniciadi, > kullanici2_.kullanicitipienum, kullanici2_.parola, kullanici2_. > soyad >          Buckets: 16384  Batches: 1  Memory Usage: 1604kB >          Buffers: shared hit=190 >          ->  Seq Scan on public.t_kullanici kullanici2_ > (cost=0.00..278.40 rows=8840 width=129) (actual time=0.005..16.630 > rows=9134 loops=1) >                Output: kullanici2_.id, kullanici2_.ad, > kullanici2_.aktif, kullanici2_.dbuser, kullanici2_.eposta, > kullanici2_.kullaniciadi, kullanici2_.kullanicitipienum, > kullanici2_.parola, kullan > ici2_.soyad >                Buffers: shared hit=190 > * Planning time: 2.331 ms* > * Execution time: 5431.817 ms* > * > * > -- Adrian Klaver adrian.klaver@aklaver.com