Forum Discussion
amrragab23
Feb 10, 2025Copper Contributor
How can I optimize this query for better performance
Hi , I have this query and it is taking a long time. If there are more than 10k rows, it takes more than 5 minutes. Is there another way to speed up the process? SELECT ROW_NUMBER() OVER (ORDER...
olafhelper
Feb 10, 2025Bronze Contributor
Is there another way to speed up the process?
A function is executed per source row and if the function runs queries, then of course that will be very slow.
Rewrite your query as one set-based query instead of using a function.