Efficient Pagination with Skip/Take

Efficient pagination using OFFSET-FETCH on SQL Server.

Execution Time

8 ms

Page Size

200

Current Page

22 / 123

Total Records

24441

Items per page: 25 50 100 200

Page 22 Results Showing 4201 - 4400 of 24441

ID Name Category Price Stock Rating Reviews SKU
4738 Economy Books Product Advanced Books $476.61 472 3.4 848 SKU-004738
4739 Professional Health & Beauty Product Classic Health & Beauty $663.30 101 1.8 725 SKU-004739
4740 Pro Books Product Lite Books $299.21 327 4.5 576 SKU-004740
4741 Elite Office Supplies Product Max Office Supplies $624.06 484 1.8 892 SKU-004741
4742 Ultra Sports & Outdoors Product Pro Sports & Outdoors $142.54 419 1.7 535 SKU-004742
4745 Economy Home & Garden Product XL Home & Garden $848.15 105 1.1 694 SKU-004745
4746 Standard Office Supplies Product Mini Office Supplies $294.13 163 1.2 948 SKU-004746
4747 Premium Books Product Max Books $940.54 110 4.7 36 SKU-004747
4748 Pro Home & Garden Product Advanced Home & Garden $752.41 67 1.3 431 SKU-004748
4749 Economy Office Supplies Product Special Edition Office Supplies $884.13 26 1.1 853 SKU-004749
4750 Economy Automotive Product Plus Automotive $457.89 18 1.9 507 SKU-004750
4751 Professional Food & Grocery Product Pro Food & Grocery $474.94 351 2.4 846 SKU-004751
4752 Mega Clothing Product Mini Clothing $919.91 0 2.2 446 SKU-004752
4753 Economy Clothing Product Plus Clothing $960.34 219 1.5 328 SKU-004753
4754 Ultra Home & Garden Product Plus Home & Garden $807.95 105 2.9 156 SKU-004754
4755 Super Home & Garden Product Lite Home & Garden $334.86 162 4.6 104 SKU-004755
4756 Premium Books Product Mini Books $983.87 379 4.6 994 SKU-004756
4757 Standard Electronics Product Mini Electronics $957.20 170 1.3 826 SKU-004757
4758 Pro Books Product Special Edition Books $460.57 118 4.9 666 SKU-004758
4759 Super Sports & Outdoors Product Advanced Sports & Outdoors $561.37 180 3.6 426 SKU-004759
4760 Pro Clothing Product Max Clothing $704.85 258 4.1 2 SKU-004760
4761 Mega Office Supplies Product Plus Office Supplies $350.53 220 4.7 480 SKU-004761
4762 Economy Clothing Product Advanced Clothing $746.97 186 1.1 761 SKU-004762
4763 Deluxe Clothing Product Advanced Clothing $417.96 431 4.6 237 SKU-004763
4764 Deluxe Electronics Product Classic Electronics $68.09 419 1.7 707 SKU-004764
4765 Super Automotive Product Lite Automotive $955.61 267 3.6 734 SKU-004765
4766 Ultra Toys & Games Product Plus Toys & Games $386.47 197 3.7 88 SKU-004766
4767 Standard Food & Grocery Product XL Food & Grocery $166.17 49 1.1 997 SKU-004767
4768 Standard Clothing Product Advanced Clothing $647.79 319 3.5 947 SKU-004768
4769 Pro Home & Garden Product Pro Home & Garden $197.16 415 1.4 962 SKU-004769
4770 Elite Books Product Max Books $727.33 368 3.3 340 SKU-004770
4772 Mega Toys & Games Product XL Toys & Games $372.31 50 3.4 901 SKU-004772
4773 Pro Sports & Outdoors Product Pro Sports & Outdoors $652.36 491 2.4 133 SKU-004773
4774 Premium Sports & Outdoors Product Special Edition Sports & Outdoors $168.87 122 4.5 632 SKU-004774
4775 Premium Health & Beauty Product Mini Health & Beauty $90.89 388 1.8 946 SKU-004775
4776 Elite Toys & Games Product Lite Toys & Games $25.69 277 1.3 398 SKU-004776
4777 Super Clothing Product XL Clothing $546.42 438 3.3 278 SKU-004777
4778 Premium Home & Garden Product XL Home & Garden $94.37 51 2.6 799 SKU-004778
4779 Economy Health & Beauty Product Mini Health & Beauty $801.90 37 3.6 993 SKU-004779
4780 Professional Clothing Product Pro Clothing $873.20 161 4.6 294 SKU-004780
4781 Ultra Health & Beauty Product Special Edition Health & Beauty $232.90 357 3.1 955 SKU-004781
4782 Deluxe Office Supplies Product XL Office Supplies $679.31 286 5.0 390 SKU-004782
4783 Pro Automotive Product 2024 Automotive $321.77 134 1.8 380 SKU-004783
4784 Mega Office Supplies Product Pro Office Supplies $787.83 332 2.0 806 SKU-004784
4785 Professional Clothing Product Mini Clothing $317.79 125 2.1 667 SKU-004785
4786 Pro Books Product Max Books $501.46 464 4.3 233 SKU-004786
4787 Ultra Clothing Product Pro Clothing $289.14 214 1.7 951 SKU-004787
4788 Standard Food & Grocery Product Plus Food & Grocery $761.35 266 3.6 864 SKU-004788
4789 Deluxe Home & Garden Product Advanced Home & Garden $826.75 139 4.6 338 SKU-004789
4790 Mega Food & Grocery Product 2024 Food & Grocery $478.16 24 3.6 346 SKU-004790
4792 Deluxe Health & Beauty Product Max Health & Beauty $689.73 155 2.5 389 SKU-004792
4793 Elite Clothing Product Lite Clothing $961.69 247 2.6 824 SKU-004793
4794 Standard Sports & Outdoors Product Max Sports & Outdoors $314.05 259 4.4 94 SKU-004794
4795 Standard Toys & Games Product Max Toys & Games $316.71 206 2.5 891 SKU-004795
4796 Mega Sports & Outdoors Product Plus Sports & Outdoors $680.45 64 2.2 352 SKU-004796
4797 Economy Home & Garden Product Classic Home & Garden $304.05 461 2.2 985 SKU-004797
4798 Pro Clothing Product Lite Clothing $39.07 291 1.2 901 SKU-004798
4799 Economy Health & Beauty Product Classic Health & Beauty $102.30 19 4.5 40 SKU-004799
4800 Mega Food & Grocery Product Mini Food & Grocery $107.78 145 2.8 707 SKU-004800
4801 Economy Home & Garden Product Pro Home & Garden $514.33 453 3.8 609 SKU-004801
4802 Deluxe Toys & Games Product Plus Toys & Games $970.02 348 3.7 420 SKU-004802
4804 Professional Books Product Advanced Books $958.45 183 2.3 15 SKU-004804
4805 Professional Toys & Games Product Special Edition Toys & Games $607.08 160 2.2 581 SKU-004805
4806 Pro Home & Garden Product Mini Home & Garden $817.74 193 1.5 995 SKU-004806
4807 Super Health & Beauty Product Classic Health & Beauty $826.40 393 2.8 590 SKU-004807
4809 Standard Clothing Product XL Clothing $374.80 171 2.2 568 SKU-004809
4810 Pro Electronics Product Pro Electronics $553.56 114 2.8 274 SKU-004810
4811 Mega Sports & Outdoors Product 2024 Sports & Outdoors $373.60 163 1.9 60 SKU-004811
4812 Professional Clothing Product Lite Clothing $226.84 119 2.4 851 SKU-004812
4814 Deluxe Electronics Product Lite Electronics $923.36 347 2.8 778 SKU-004814
4815 Elite Books Product Lite Books $393.86 127 1.4 926 SKU-004815
4816 Professional Toys & Games Product Pro Toys & Games $95.62 75 1.2 900 SKU-004816
4817 Professional Toys & Games Product Mini Toys & Games $562.79 262 3.4 512 SKU-004817
4818 Mega Electronics Product 2024 Electronics $265.15 219 4.6 234 SKU-004818
4819 Deluxe Food & Grocery Product Mini Food & Grocery $452.01 99 4.7 722 SKU-004819
4820 Ultra Automotive Product Plus Automotive $455.98 360 4.3 23 SKU-004820
4821 Economy Automotive Product Lite Automotive $180.33 481 2.5 821 SKU-004821
4822 Pro Health & Beauty Product Max Health & Beauty $55.64 155 1.2 514 SKU-004822
4823 Standard Sports & Outdoors Product Mini Sports & Outdoors $313.48 192 3.0 813 SKU-004823
4824 Pro Books Product Lite Books $414.04 5 1.3 629 SKU-004824
4825 Pro Automotive Product Classic Automotive $182.29 202 2.8 767 SKU-004825
4826 Elite Toys & Games Product Special Edition Toys & Games $116.20 358 2.1 613 SKU-004826
4827 Economy Home & Garden Product Plus Home & Garden $11.54 448 3.7 535 SKU-004827
4828 Ultra Office Supplies Product Classic Office Supplies $414.76 478 4.3 475 SKU-004828
4829 Professional Home & Garden Product Plus Home & Garden $51.07 46 4.1 621 SKU-004829
4830 Elite Office Supplies Product Plus Office Supplies $997.56 206 2.2 141 SKU-004830
4831 Pro Sports & Outdoors Product Pro Sports & Outdoors $92.43 90 4.2 198 SKU-004831
4832 Premium Automotive Product Max Automotive $471.69 5 1.2 863 SKU-004832
4833 Deluxe Office Supplies Product Advanced Office Supplies $119.55 384 3.0 658 SKU-004833
4834 Economy Electronics Product Mini Electronics $253.81 20 2.9 430 SKU-004834
4835 Mega Electronics Product Pro Electronics $973.19 29 1.9 465 SKU-004835
4836 Economy Automotive Product Max Automotive $693.02 485 3.0 469 SKU-004836
4837 Professional Automotive Product Pro Automotive $437.66 371 1.3 790 SKU-004837
4838 Ultra Books Product Classic Books $375.19 166 2.9 236 SKU-004838
4839 Mega Electronics Product Special Edition Electronics $434.21 178 4.4 487 SKU-004839
4840 Economy Electronics Product Classic Electronics $470.66 189 2.0 333 SKU-004840
4841 Super Home & Garden Product 2024 Home & Garden $593.10 10 4.8 687 SKU-004841
4842 Elite Automotive Product Special Edition Automotive $366.89 255 4.0 899 SKU-004842
4843 Mega Health & Beauty Product Plus Health & Beauty $93.56 78 2.0 706 SKU-004843
4844 Pro Clothing Product Lite Clothing $224.07 453 1.6 771 SKU-004844
4845 Elite Food & Grocery Product Advanced Food & Grocery $78.11 194 3.6 40 SKU-004845
4846 Ultra Automotive Product 2024 Automotive $876.70 113 3.5 44 SKU-004846
4848 Deluxe Sports & Outdoors Product Max Sports & Outdoors $705.02 249 4.5 41 SKU-004848
4849 Standard Automotive Product Classic Automotive $957.93 213 3.1 58 SKU-004849
4850 Standard Food & Grocery Product Pro Food & Grocery $978.93 417 3.7 278 SKU-004850
4851 Economy Automotive Product Lite Automotive $914.25 352 3.7 408 SKU-004851
4852 Super Sports & Outdoors Product Mini Sports & Outdoors $354.58 192 2.9 399 SKU-004852
4853 Super Food & Grocery Product Pro Food & Grocery $307.37 202 2.1 309 SKU-004853
4854 Ultra Electronics Product Plus Electronics $220.76 4 2.2 697 SKU-004854
4855 Elite Sports & Outdoors Product Special Edition Sports & Outdoors $590.68 73 4.2 694 SKU-004855
4856 Pro Electronics Product XL Electronics $986.76 200 1.8 619 SKU-004856
4858 Standard Home & Garden Product Lite Home & Garden $716.29 79 4.4 414 SKU-004858
4859 Standard Food & Grocery Product Advanced Food & Grocery $939.72 384 1.9 570 SKU-004859
4860 Ultra Sports & Outdoors Product 2024 Sports & Outdoors $553.71 104 4.0 750 SKU-004860
4861 Mega Health & Beauty Product Pro Health & Beauty $448.36 169 2.4 360 SKU-004861
4863 Ultra Electronics Product Max Electronics $630.06 184 4.3 365 SKU-004863
4864 Economy Clothing Product 2024 Clothing $980.86 296 3.6 454 SKU-004864
4865 Economy Electronics Product Mini Electronics $37.26 70 3.7 24 SKU-004865
4866 Ultra Electronics Product Advanced Electronics $562.90 441 3.2 889 SKU-004866
4868 Elite Health & Beauty Product Plus Health & Beauty $899.08 397 1.6 817 SKU-004868
4869 Premium Clothing Product Special Edition Clothing $157.33 53 3.9 186 SKU-004869
4870 Premium Books Product Advanced Books $286.91 106 2.6 976 SKU-004870
4871 Premium Clothing Product Plus Clothing $184.62 406 4.5 2 SKU-004871
4872 Economy Toys & Games Product Pro Toys & Games $489.28 279 1.2 383 SKU-004872
4873 Ultra Electronics Product XL Electronics $234.60 164 4.1 871 SKU-004873
4874 Economy Books Product XL Books $240.14 117 4.8 994 SKU-004874
4875 Pro Sports & Outdoors Product XL Sports & Outdoors $825.39 449 3.4 520 SKU-004875
4876 Super Electronics Product Classic Electronics $443.59 402 3.2 957 SKU-004876
4877 Elite Food & Grocery Product Special Edition Food & Grocery $523.30 455 2.3 276 SKU-004877
4878 Economy Electronics Product Mini Electronics $353.37 210 2.9 200 SKU-004878
4879 Professional Home & Garden Product Lite Home & Garden $372.83 44 4.2 544 SKU-004879
4880 Elite Food & Grocery Product Lite Food & Grocery $131.28 32 5.0 551 SKU-004880
4881 Ultra Office Supplies Product Pro Office Supplies $996.38 400 4.4 369 SKU-004881
4882 Super Toys & Games Product 2024 Toys & Games $449.04 293 3.1 651 SKU-004882
4884 Mega Toys & Games Product Mini Toys & Games $303.34 86 4.2 3 SKU-004884
4885 Super Electronics Product Classic Electronics $891.96 311 2.4 100 SKU-004885
4886 Elite Health & Beauty Product Classic Health & Beauty $115.58 13 2.2 372 SKU-004886
4887 Elite Home & Garden Product Advanced Home & Garden $313.91 111 2.9 304 SKU-004887
4888 Deluxe Office Supplies Product Lite Office Supplies $235.46 315 3.2 855 SKU-004888
4889 Standard Clothing Product Advanced Clothing $726.44 123 4.7 84 SKU-004889
4890 Elite Books Product Plus Books $728.40 197 4.6 533 SKU-004890
4891 Deluxe Electronics Product Plus Electronics $284.31 428 4.7 568 SKU-004891
4892 Professional Toys & Games Product Plus Toys & Games $159.12 136 2.2 859 SKU-004892
4893 Professional Home & Garden Product XL Home & Garden $394.55 255 3.2 892 SKU-004893
4894 Economy Electronics Product Lite Electronics $304.52 108 2.3 153 SKU-004894
4895 Super Clothing Product Mini Clothing $640.86 203 3.5 602 SKU-004895
4897 Ultra Office Supplies Product Classic Office Supplies $360.86 3 2.3 260 SKU-004897
4898 Elite Electronics Product Pro Electronics $67.10 388 4.2 672 SKU-004898
4899 Mega Automotive Product 2024 Automotive $47.91 9 3.0 54 SKU-004899
4900 Deluxe Home & Garden Product XL Home & Garden $331.68 346 3.9 71 SKU-004900
4901 Mega Food & Grocery Product Mini Food & Grocery $664.56 150 2.9 436 SKU-004901
4902 Super Office Supplies Product Mini Office Supplies $720.19 306 2.1 26 SKU-004902
4903 Deluxe Automotive Product Lite Automotive $161.26 378 3.3 861 SKU-004903
4905 Elite Electronics Product Mini Electronics $789.65 323 1.1 153 SKU-004905
4907 Super Office Supplies Product Classic Office Supplies $936.25 410 3.7 510 SKU-004907
4908 Elite Food & Grocery Product Lite Food & Grocery $516.45 355 2.3 416 SKU-004908
4909 Ultra Toys & Games Product XL Toys & Games $57.72 390 2.4 643 SKU-004909
4910 Economy Clothing Product Classic Clothing $208.49 390 4.1 244 SKU-004910
4911 Elite Books Product Advanced Books $987.45 382 2.2 113 SKU-004911
4912 Premium Health & Beauty Product 2024 Health & Beauty $818.56 124 1.8 624 SKU-004912
4913 Elite Electronics Product 2024 Electronics $991.80 44 3.3 623 SKU-004913
4914 Economy Clothing Product Mini Clothing $814.89 109 2.4 289 SKU-004914
4915 Super Office Supplies Product Classic Office Supplies $924.22 291 3.6 800 SKU-004915
4916 Pro Electronics Product Plus Electronics $220.28 51 2.3 499 SKU-004916
4917 Premium Food & Grocery Product Advanced Food & Grocery $482.90 182 4.0 629 SKU-004917
4918 Standard Sports & Outdoors Product Advanced Sports & Outdoors $256.09 320 2.2 446 SKU-004918
4921 Ultra Food & Grocery Product Lite Food & Grocery $589.57 299 4.6 910 SKU-004921
4922 Pro Food & Grocery Product Lite Food & Grocery $815.88 32 1.8 636 SKU-004922
4923 Pro Sports & Outdoors Product Max Sports & Outdoors $467.43 352 1.8 868 SKU-004923
4924 Professional Clothing Product Lite Clothing $338.95 48 2.0 883 SKU-004924
4925 Elite Clothing Product 2024 Clothing $493.27 455 4.3 569 SKU-004925
4926 Pro Home & Garden Product Lite Home & Garden $952.21 379 2.1 394 SKU-004926
4927 Ultra Clothing Product 2024 Clothing $80.57 498 3.1 995 SKU-004927
4928 Pro Toys & Games Product Advanced Toys & Games $130.81 348 2.0 687 SKU-004928
4929 Elite Home & Garden Product Classic Home & Garden $25.84 474 1.2 131 SKU-004929
4930 Elite Food & Grocery Product 2024 Food & Grocery $217.76 414 1.5 677 SKU-004930
4931 Pro Books Product Lite Books $97.50 238 1.8 312 SKU-004931
4932 Elite Food & Grocery Product Pro Food & Grocery $107.14 462 2.0 916 SKU-004932
4933 Mega Books Product Classic Books $231.24 251 4.7 715 SKU-004933
4935 Premium Clothing Product Advanced Clothing $202.58 93 2.0 3 SKU-004935
4936 Economy Food & Grocery Product XL Food & Grocery $965.37 326 1.4 919 SKU-004936
4937 Economy Sports & Outdoors Product Plus Sports & Outdoors $273.92 110 1.2 655 SKU-004937
4938 Deluxe Sports & Outdoors Product Lite Sports & Outdoors $351.75 18 2.6 678 SKU-004938
4939 Super Health & Beauty Product Plus Health & Beauty $840.62 442 1.7 674 SKU-004939
4940 Super Electronics Product Mini Electronics $49.56 489 3.7 649 SKU-004940
4941 Elite Clothing Product 2024 Clothing $517.32 375 1.3 249 SKU-004941
4942 Professional Office Supplies Product 2024 Office Supplies $185.98 75 4.2 351 SKU-004942
4943 Ultra Food & Grocery Product Pro Food & Grocery $242.32 225 1.8 486 SKU-004943
4944 Standard Automotive Product Advanced Automotive $154.03 443 2.6 992 SKU-004944
4945 Ultra Sports & Outdoors Product Lite Sports & Outdoors $33.69 437 2.5 157 SKU-004945
4946 Economy Sports & Outdoors Product Advanced Sports & Outdoors $774.50 400 4.8 614 SKU-004946
4947 Standard Automotive Product Advanced Automotive $669.31 269 3.4 483 SKU-004947
4948 Economy Automotive Product Plus Automotive $884.30 330 1.2 718 SKU-004948
4949 Super Clothing Product Classic Clothing $553.61 74 3.5 259 SKU-004949
4950 Mega Home & Garden Product 2024 Home & Garden $416.11 96 2.2 387 SKU-004950
4951 Standard Health & Beauty Product Lite Health & Beauty $165.16 21 1.6 872 SKU-004951
4952 Pro Books Product Lite Books $296.06 114 1.4 350 SKU-004952
4954 Professional Food & Grocery Product 2024 Food & Grocery $457.66 414 2.9 45 SKU-004954
4955 Premium Food & Grocery Product Plus Food & Grocery $964.73 491 2.4 243 SKU-004955
4956 Deluxe Toys & Games Product Classic Toys & Games $596.60 218 3.8 243 SKU-004956
Implementation Code
// Efficient pagination with Skip and Take
public async Task<PaginatedResult<DemoProduct>> GetPaginatedProductsAsync(int page, int pageSize)
{
    // Get total count (cached if possible)
    var totalCount = await _context.DemoProducts.CountAsync(p => p.IsActive);
    
    // Get page of results
    var items = await _context.DemoProducts
        .Where(p => p.IsActive)
        .OrderBy(p => p.Id) // Important: Must have ORDER BY for consistent paging
        .Skip((page - 1) * pageSize) // OFFSET in SQL
        .Take(pageSize) // FETCH NEXT in SQL
        .AsNoTracking() // No tracking needed for read-only
        .ToListAsync();

    return new PaginatedResult<DemoProduct>
    {
        Items = items,
        TotalCount = totalCount,
        Page = page,
        PageSize = pageSize
    };
}
Pagination Best Practices
  • Always use OrderBy: Skip/Take require stable sorting for consistent results
  • Use AsNoTracking(): Pagination queries are typically read-only
  • Consider caching: Cache total count if dataset changes infrequently
  • Limit max page size: Prevent users from requesting too many records at once
  • Use indexed columns: Ensure ORDER BY columns are indexed for performance