Hi,
I am trying to create sp for grid paging and I am using CTE,
my CTE query is ,
with cte as
(select .......)
select * from cte
this query takes 250ms to execute,
but when I am adding the count() for counting the cte query record it is taking about 700ms to execute....
after adding count() cte like,
with cte as
(select .......)
,cte2 as (select count(column) as cnt from cte)
select cnt,* from cte,cte2
as I am runing single select query with count() it is taking about 80ms
I need the row count of cte query with better performance,
please let me know if it is any thing wrong.
Thanks.