i use a query like:
select CUSTOMER_ID INTO #mc FROM USR_Customer_VW
select TOP 3500 v.CUSTOMER_ID,x.* from #mc v CROSS APPLY [dbo].[udf_GetMaxDate](v.customer_id) x
the view USR_Customer_VW will return more than 10 thousands, udf is a table value function return many columns. when I use top 1000 or top 2000 it will run less than 1 second. but if I use top 3500 it will run more than 30 seconds. can any professional can help me for the issue?
asked Jul 08 at 02:35 AM in Default
If you can provider sample data with some dummy columns then we can help otherwise check this post out. Try forcing the order like suggested on the link and see what happens. https://stackoverflow.com/questions/17567674/cross-apply-performance-difference
answered Jul 08 at 09:45 PM