I am curious if there is a way to find where a query is running in whatever project, like some sort of search function either on the gateway or in the designer.
I have a query that runs every 30secs and want to locate it to see if it really needs to.
Let me know whatever info I need to submit to help yall, help me. Thanks!
If you have an idea what that query does or what happen when that script activate (some text, some action, some popup...) you can look for a piece of code matching that.
If you have no idea what it does you will have to search all the scripts and queries for something looping each ? seconds
runQuery
runNamedQuery
runScript
...
See if you can catch it on the gateway → Status → DATABASES → Database Stats.
Maybe hit PrtScrn to capture it and to test your reaction times! Alternatively run a video capture program. https://www.screentogif.com/ (for Windows) is easy to use and useful for short video clips to be posted on the forum.
1 Like
Heres the query:
WITH CTE
AS
(
SELECT ID
,AGV_ID
,STAMP
,ROW_NUMBER() OVER (PARTITION BY ID, AGV_Error_Type, STAMP ORDER BY STAMP) AS RowNum
FROM Plt65_AGVTrace
)
SELECT ID
FROM CTE
WHERE RowNum = 2
I am looking in the diagos for it now to help me locate it.
I've updated my previous post to look for queries rather than scripts. Sorry for the confusion.
You can set the gateway.Database.SELECTS
logger to TRACE, and if you're lucky the occurrences of the query will be logged with MDC keys (the magnifying glass on the logging web page) that help identify where it came from.
Note that this will log every single query from every single database connection, so it's going to be very noisy. You could turn it on for a couple of minutes, then dump the logs and use Kindling to review.
1 Like
Thanks guys. I found it. I used mmsm trace and the way it was running constantly at 30sec, I figured it was a tag. Then using the tag report tool, i filtered by query tags and group rate of 30secs and found it.
3 Likes