Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
On 05/30/2018 07:41 AM, Yavuz Selim Sertoğlu wrote: Major upgrade would be very painful because there are many application running on different servers but same database server. FYI, 9.5.3 --> 9.5.13 is considered a minor upgrade. Their tests would take too much time. So I will try to go with

Re: Query running for 12 hours

2018-05-30 Thread Yavuz Selim Sertoğlu
Major upgrade would be very painful because there are many application running on different servers but same database server. Their tests would take too much time. So I will try to go with minor upgrade. Thanks for your help, have a good day. >> > Remaining suggestions/questions: > > 1) If it

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
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 n

Re: Query running for 12 hours

2018-05-30 Thread Yavuz Selim Sertoğlu
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:

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
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

Re: Query running for 12 hours

2018-05-30 Thread 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_sta

Re: Query running for 12 hours

2018-05-30 Thread Melvin Davidson
On Wed, May 30, 2018 at 9:54 AM, Yavuz Selim Sertoğlu < yavuzselim.serto...@bisoft.com.tr> 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:0

Re: Query running for 12 hours

2018-05-30 Thread Yavuz Selim Sertoğlu
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* *Here are todays log lines for that query.* tarih=2018-05-30 02:12:19 +03,session_number=1,db=mydb,use

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
On 05/30/2018 04:37 AM, Yavuz Selim Sertoğlu wrote: Hi everybody, * * *Today I saw that two queries have been running for more then 12 hours(They are the same query actually).* /mydb=# select * from pg_stat_activity where state='active' and state_change < now()-'12 hours'::interval;/ *I

Query running for 12 hours

2018-05-30 Thread Yavuz Selim Sertoğlu
Hi everybody, *Today I saw that two queries have been running for more then 12 hours(They are the same query actually).* *mydb=# select * from pg_stat_activity where state='active' and state_change < now()-'12 hours'::interval;* -[ RECORD 1 ]+-