SQlserver efficient paging, still using row_number (), top of the class?

row_number (), or the top of these pages are relatively old methods, efficiency is not very efficient,

Under Sqlserve2012 there, the efficiency of contrast is more obvious, especially in the data is relatively large (we can watch a query execution plan)

Offset 0 Rows Fetch Next 20 Rows only (need to sort)

Here a single orders of sql, played only serve as a stimulus:

select id,name from Student order by id desc  Offset 0 Rows Fetch Next 20 Rows only

 

Guess you like

Origin www.cnblogs.com/Fengge518/p/11448650.html