Somewhat related, there is `current_queries` and `...
# questions-and-troubleshooting
g
Somewhat related, there is
current_queries
and
current_global_queries
in the system info front end. • what's the difference between these two • is there an easy way to see the query string for a specific query?
е
current_queries does not consult leader fe if run on secondary node
show proc ‘/querrent_queries/query_id’ will get you a query text
g
running
SHOW PROC '/current_queries'
gives me nothing running
SHOW PROC '/global_current_queries'
gives me all running queries so I suppose i'm running on the secondary node but then running
SHOW PROC '/global_current_queries/query_id'
gives me
Copy code
SQL Error [1064] [42000]: Getting analyzing error. Detail message: Unknown proc node path: /global_current_queries/0c96e7ec-81b7-11f0-b3a7-9e12b4d32660. msg: not implemented.
d
try '/current_queries/query_id' on leader FE
g
I do think that would work but I generally hit my FEs through a load balancer
d
what's the reason of getting a specific query
g
Curiosity? Really it's because I go on the
current_global_queries
section of system info on the front end and see a long running query using lots of mem/cpu/both and want to figure out what it is to see if I can make the query more performant.
d
you can take a look at FE's audit log in log dir to get the long running query and turn on SQL profile to gather sql running info