pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Yavuz Selim Sertoğlu <yavuzselim.sertoglu@bisoft.com.tr>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Query running for 12 hours
Date: Wed, 30 May 2018 07:02:04 -0700
Message-ID: <7c2c3680-49a7-e6ce-82e1-171ba3e6db43@aklaver.com> (raw)
In-Reply-To: <CAJTnKsp1+0GP8GBtOfeq5zyCd9mGE+U6_hG8J0n5iM=CXoNR0A@mail.gmail.com>
References: <CAJTnKsqCvtCfOq5rL1S0scK6XMef4pjh5ty2pkFAuFCagK6VPQ@mail.gmail.com>
	<56911e4e-d8a7-1770-7f6b-cd2104979693@aklaver.com>
	<CAJTnKsp1+0GP8GBtOfeq5zyCd9mGE+U6_hG8J0n5iM=CXoNR0A@mail.gmail.com>

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




view thread (10+ messages)  latest in thread

Message-ID: <7c2c3680-49a7-e6ce-82e1-171ba3e6db43@aklaver.com>
Permalink:  ../7c2c3680-49a7-e6ce-82e1-171ba3e6db43@aklaver.com/
Also on:    postgresql.org/message-id/7c2c3680-49a7-e6ce-82e1-171ba3e6db43@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, yavuzselim.sertoglu@bisoft.com.tr
  Subject: Re: Query running for 12 hours
  In-Reply-To: <7c2c3680-49a7-e6ce-82e1-171ba3e6db43@aklaver.com>
  References: <CAJTnKsqCvtCfOq5rL1S0scK6XMef4pjh5ty2pkFAuFCagK6VPQ@mail.gmail.com> <56911e4e-d8a7-1770-7f6b-cd2104979693@aklaver.com> <CAJTnKsp1+0GP8GBtOfeq5zyCd9mGE+U6_hG8J0n5iM=CXoNR0A@mail.gmail.com> <7c2c3680-49a7-e6ce-82e1-171ba3e6db43@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox