Need help understanding Query performance insights for Azure sql

Ryan Brown 0 Reputation points
2025-02-25T21:07:45.8366667+00:00
  1. In Azure I go to my database and choose Performance Overview | Query Performance insight and it shows me long running queries.
  2. I click it to get details and I then click again to see the details of one of the queries.
  3. It says in the last 24 hours it has run 44 times for a total of over 8 hours. (First screenshot)
  4. I click it to see what the query was. (Second and third screenshot)
  5. The sql query it shows is nowhere in our code.

LN1.png

LN2.png

LN3.png

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 117.8K Reputation points MVP
    2025-02-25T22:19:28.17+00:00

    Since I don't know anything about your database or environment, I don't know exactly what you define as "our code". It could be a query coming in from the left from a Power BI report or similar.

    I would set up some form of auditing or extended-events session to get more information of what this may be coming from.

    0 comments No comments

  2. PratikLad 80 Reputation points Microsoft Vendor
    2025-02-28T11:55:48.39+00:00

    Hi Ryan Brown,

    In addition to @Erland Sommarskog response, you can also consider...

    Understanding Query Performance Insight & Tracking Query Execution

    Query Performance Insight provides intelligent query analysis for single and pooled Azure SQL databases. It helps identify top resource-consuming and long-running queries in your workload. This allows you to optimize queries to improve overall performance and make efficient use of the resources you are paying for.

    How to Identify Who Executed a Query

    To track who ran a specific query, you need to enable SQL Auditing.

    Azure SQL Auditing

    Auditing for Azure SQL Database tracks database events and writes them to:

    • Azure Storage Account
    • Log Analytics Workspace
    • Event Hubs

    Next Steps

    To find out who executed a specific query:

    1. Enable SQL Auditing in the Azure Portal

    1. Query Log Analytics using KQL to check for query execution details (e.g., client IP, username, application name).
    2. Use Extended Events if real-time tracking is needed.

    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.