Which query would you use to find connections that are in the same state for longer than 180 seconds?

Which query would you use to find connections that are in the same state for longer than 180
seconds?

Which query would you use to find connections that are in the same state for longer than 180
seconds?

A.
SHOW FULL PROCESSLIST WHEER Time > 180;

B.
SELECT * FROM INFORMATION_SCHEMA.EVENTS SHERE STARTS < (DATE_SUB (NOW
( ), INTERVAL 180 SECOND) );

C.
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE STATE <
(DATE_SUB (NOW ( ), INTERVAL 180 SECOND) );

D.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE TIME > 180;

Explanation:



Leave a Reply 6

Your email address will not be published. Required fields are marked *


Ispanico

Ispanico

correct answer D
A and C are sintattically wrong

Jose Wilson

Jose Wilson

Correct answer is D :

mysql> select * from information_schema.PROCESSLIST where time > 180;

+—-+—————–+———–+——+———+———+—————————–+——+————+
| ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | TIME_MS |
+—-+—————–+———–+——+———+———+—————————–+——+————+
| 1 | event_scheduler | localhost | NULL | Daemon | 880 | Waiting for next activation | NULL | |
+—-+—————–+———–+——+———+———+—————————–+——+————+
1 row in set (0.00 sec)

mysql> show full processlist where time > 180;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘where time > 180’ at line 1

use this link

use this link

Pretty! This has been an extremely wonderful article. Thank you for providing these details.|

this site

this site

Excellent post. I used to be checking continuously this blog and I’m impressed! Very useful info specifically the final part 🙂 I deal with such info much. I was seeking this certain info for a long time. Thanks and best of luck. |

stay with me

stay with me

Pretty! This has been an extremely wonderful article. Thank you for supplying these details.|