Hi @SVA
Run the query with SET STATISTICS TIME ON
and SET STATISTICS IO ON
. Check whether the performance is poor due to physical I/O. If the data page to be accessed by a statement is not cached in memory in advance, then the data page must be read from disk to memory during the operation of the statement, which is a very expensive action.
Please refer to this doc for more details: Troubleshoot slow-running queries on SQL Server.
Best regards,
Cosmog Hong
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.