Efficient Pagination with Skip/Take

Efficient pagination using OFFSET-FETCH on SQL Server.

Execution Time

1803 ms

Page Size

200

Current Page

12 / 123

Total Records

24441

Items per page: 25 50 100 200

Page 12 Results Showing 2201 - 2400 of 24441

ID Name Category Price Stock Rating Reviews SKU
2477 Ultra Home & Garden Product 2024 Home & Garden $368.16 433 1.2 880 SKU-002477
2478 Premium Home & Garden Product Pro Home & Garden $928.64 138 1.0 740 SKU-002478
2479 Pro Home & Garden Product Max Home & Garden $437.66 479 1.4 73 SKU-002479
2480 Mega Books Product Classic Books $496.24 339 1.7 783 SKU-002480
2481 Pro Automotive Product Mini Automotive $456.50 414 2.5 599 SKU-002481
2482 Pro Food & Grocery Product Mini Food & Grocery $650.73 185 3.8 100 SKU-002482
2483 Super Home & Garden Product Lite Home & Garden $214.20 135 3.9 571 SKU-002483
2484 Professional Home & Garden Product Pro Home & Garden $961.32 91 4.3 850 SKU-002484
2485 Pro Sports & Outdoors Product Advanced Sports & Outdoors $896.88 271 1.6 731 SKU-002485
2486 Standard Health & Beauty Product XL Health & Beauty $471.92 37 4.2 8 SKU-002486
2487 Super Food & Grocery Product Pro Food & Grocery $243.29 310 1.9 583 SKU-002487
2488 Economy Food & Grocery Product Mini Food & Grocery $70.42 393 2.7 517 SKU-002488
2489 Deluxe Sports & Outdoors Product XL Sports & Outdoors $957.03 201 3.0 318 SKU-002489
2490 Economy Office Supplies Product Pro Office Supplies $73.35 57 3.8 516 SKU-002490
2491 Ultra Automotive Product 2024 Automotive $579.27 145 2.3 642 SKU-002491
2492 Elite Electronics Product Max Electronics $116.78 395 4.2 360 SKU-002492
2493 Professional Automotive Product Pro Automotive $472.66 174 3.4 906 SKU-002493
2494 Pro Sports & Outdoors Product Plus Sports & Outdoors $984.87 232 1.6 192 SKU-002494
2495 Economy Home & Garden Product Lite Home & Garden $85.03 91 3.5 176 SKU-002495
2497 Professional Food & Grocery Product 2024 Food & Grocery $707.48 119 4.8 4 SKU-002497
2498 Premium Books Product 2024 Books $569.63 97 4.2 588 SKU-002498
2499 Super Home & Garden Product Classic Home & Garden $404.05 126 3.3 237 SKU-002499
2500 Pro Electronics Product XL Electronics $507.51 53 2.4 719 SKU-002500
2501 Pro Food & Grocery Product Pro Food & Grocery $684.42 345 4.5 282 SKU-002501
2502 Premium Toys & Games Product Advanced Toys & Games $810.60 272 1.4 377 SKU-002502
2503 Ultra Electronics Product Pro Electronics $866.19 25 4.9 929 SKU-002503
2504 Ultra Books Product XL Books $834.06 51 4.7 145 SKU-002504
2505 Economy Automotive Product XL Automotive $601.28 76 3.6 514 SKU-002505
2506 Mega Sports & Outdoors Product Special Edition Sports & Outdoors $630.45 190 5.0 322 SKU-002506
2507 Standard Toys & Games Product 2024 Toys & Games $146.80 178 1.2 485 SKU-002507
2508 Super Books Product Plus Books $806.77 420 4.1 156 SKU-002508
2509 Mega Office Supplies Product Pro Office Supplies $625.10 493 3.4 209 SKU-002509
2510 Economy Electronics Product Pro Electronics $906.74 227 1.3 218 SKU-002510
2511 Premium Clothing Product 2024 Clothing $140.23 458 1.6 573 SKU-002511
2512 Super Food & Grocery Product Special Edition Food & Grocery $445.41 18 2.0 285 SKU-002512
2513 Ultra Home & Garden Product Lite Home & Garden $360.84 48 1.9 475 SKU-002513
2514 Mega Clothing Product Advanced Clothing $691.86 287 4.0 3 SKU-002514
2515 Pro Food & Grocery Product Special Edition Food & Grocery $42.01 240 3.5 965 SKU-002515
2516 Ultra Electronics Product Plus Electronics $546.21 293 2.2 578 SKU-002516
2517 Ultra Automotive Product Special Edition Automotive $288.96 280 3.5 259 SKU-002517
2518 Super Sports & Outdoors Product Advanced Sports & Outdoors $817.83 88 1.6 860 SKU-002518
2519 Economy Electronics Product Classic Electronics $634.52 409 3.2 136 SKU-002519
2520 Economy Books Product Classic Books $212.39 59 3.5 541 SKU-002520
2521 Premium Toys & Games Product Special Edition Toys & Games $614.56 489 4.6 747 SKU-002521
2522 Elite Health & Beauty Product Lite Health & Beauty $419.04 82 3.5 940 SKU-002522
2523 Ultra Clothing Product Plus Clothing $206.51 60 3.2 969 SKU-002523
2524 Pro Automotive Product Plus Automotive $45.22 217 3.4 30 SKU-002524
2525 Elite Clothing Product Special Edition Clothing $305.00 15 4.6 461 SKU-002525
2526 Economy Automotive Product Classic Automotive $369.97 449 2.5 212 SKU-002526
2527 Premium Toys & Games Product Pro Toys & Games $42.35 299 4.8 124 SKU-002527
2529 Economy Automotive Product XL Automotive $425.52 489 4.0 476 SKU-002529
2530 Deluxe Toys & Games Product XL Toys & Games $257.43 320 2.0 459 SKU-002530
2531 Deluxe Toys & Games Product Advanced Toys & Games $724.76 475 3.2 344 SKU-002531
2532 Super Home & Garden Product Plus Home & Garden $120.90 421 1.5 939 SKU-002532
2533 Elite Books Product Lite Books $649.81 331 2.9 85 SKU-002533
2534 Economy Office Supplies Product Pro Office Supplies $530.71 133 1.9 569 SKU-002534
2535 Deluxe Health & Beauty Product Plus Health & Beauty $536.89 153 1.5 399 SKU-002535
2537 Standard Automotive Product Mini Automotive $317.33 204 1.8 498 SKU-002537
2538 Premium Books Product 2024 Books $221.56 445 3.0 335 SKU-002538
2540 Premium Electronics Product Special Edition Electronics $782.84 349 3.8 587 SKU-002540
2541 Mega Electronics Product Plus Electronics $677.89 7 2.8 631 SKU-002541
2542 Elite Health & Beauty Product Advanced Health & Beauty $330.25 310 1.5 779 SKU-002542
2543 Pro Toys & Games Product Advanced Toys & Games $47.47 301 1.9 10 SKU-002543
2544 Deluxe Automotive Product Max Automotive $789.90 324 4.2 210 SKU-002544
2545 Economy Clothing Product Special Edition Clothing $633.96 162 3.4 786 SKU-002545
2547 Premium Toys & Games Product Max Toys & Games $536.12 445 3.4 155 SKU-002547
2548 Mega Home & Garden Product Lite Home & Garden $723.68 13 2.7 791 SKU-002548
2549 Premium Automotive Product Special Edition Automotive $592.57 56 1.8 6 SKU-002549
2550 Deluxe Food & Grocery Product XL Food & Grocery $341.47 328 1.7 510 SKU-002550
2551 Premium Electronics Product Pro Electronics $289.28 269 4.5 88 SKU-002551
2552 Elite Toys & Games Product Mini Toys & Games $790.67 13 4.3 589 SKU-002552
2553 Mega Sports & Outdoors Product Lite Sports & Outdoors $925.28 119 4.4 393 SKU-002553
2555 Standard Food & Grocery Product Special Edition Food & Grocery $57.55 49 4.8 688 SKU-002555
2556 Professional Office Supplies Product Mini Office Supplies $779.42 472 2.1 58 SKU-002556
2557 Premium Office Supplies Product Pro Office Supplies $873.80 230 2.4 882 SKU-002557
2558 Premium Health & Beauty Product Classic Health & Beauty $613.28 326 2.9 673 SKU-002558
2559 Ultra Home & Garden Product Plus Home & Garden $79.97 183 1.7 141 SKU-002559
2560 Pro Food & Grocery Product 2024 Food & Grocery $833.81 336 2.0 450 SKU-002560
2561 Professional Toys & Games Product Special Edition Toys & Games $459.41 104 1.6 976 SKU-002561
2562 Professional Sports & Outdoors Product XL Sports & Outdoors $367.09 105 4.8 335 SKU-002562
2563 Premium Home & Garden Product Lite Home & Garden $340.36 275 3.1 748 SKU-002563
2564 Elite Books Product 2024 Books $641.36 422 2.1 691 SKU-002564
2565 Economy Sports & Outdoors Product XL Sports & Outdoors $165.43 457 1.6 562 SKU-002565
2566 Ultra Food & Grocery Product Pro Food & Grocery $635.83 266 3.9 243 SKU-002566
2567 Deluxe Automotive Product XL Automotive $436.72 361 4.2 591 SKU-002567
2568 Professional Automotive Product Advanced Automotive $169.78 36 2.8 869 SKU-002568
2569 Deluxe Clothing Product 2024 Clothing $315.20 463 4.6 864 SKU-002569
2570 Pro Home & Garden Product Advanced Home & Garden $381.93 312 4.4 183 SKU-002570
2571 Pro Health & Beauty Product 2024 Health & Beauty $145.09 43 4.9 869 SKU-002571
2572 Deluxe Clothing Product Lite Clothing $485.28 181 4.0 690 SKU-002572
2573 Economy Office Supplies Product Max Office Supplies $24.64 141 3.9 34 SKU-002573
2574 Ultra Automotive Product Plus Automotive $779.56 246 1.3 321 SKU-002574
2575 Ultra Toys & Games Product Advanced Toys & Games $805.52 120 1.6 523 SKU-002575
2576 Economy Clothing Product Advanced Clothing $554.26 53 3.0 431 SKU-002576
2577 Ultra Automotive Product Pro Automotive $825.09 325 3.1 736 SKU-002577
2578 Ultra Clothing Product Plus Clothing $787.26 156 4.6 545 SKU-002578
2579 Mega Toys & Games Product 2024 Toys & Games $289.54 169 4.5 790 SKU-002579
2581 Mega Home & Garden Product Mini Home & Garden $53.61 160 2.0 928 SKU-002581
2583 Deluxe Food & Grocery Product Special Edition Food & Grocery $923.36 432 2.8 143 SKU-002583
2584 Economy Food & Grocery Product Advanced Food & Grocery $159.69 161 4.2 445 SKU-002584
2585 Ultra Toys & Games Product XL Toys & Games $578.76 468 4.0 810 SKU-002585
2586 Pro Clothing Product Special Edition Clothing $544.13 24 1.5 79 SKU-002586
2587 Elite Clothing Product Classic Clothing $831.69 410 1.5 896 SKU-002587
2588 Mega Clothing Product Advanced Clothing $801.36 268 2.8 166 SKU-002588
2589 Economy Health & Beauty Product Pro Health & Beauty $309.64 126 1.9 216 SKU-002589
2592 Standard Sports & Outdoors Product Pro Sports & Outdoors $877.62 333 4.9 822 SKU-002592
2593 Elite Toys & Games Product Max Toys & Games $266.35 220 3.7 538 SKU-002593
2594 Deluxe Home & Garden Product Mini Home & Garden $164.46 46 1.1 153 SKU-002594
2595 Professional Food & Grocery Product Plus Food & Grocery $580.48 10 3.5 264 SKU-002595
2596 Super Health & Beauty Product Classic Health & Beauty $856.48 79 2.3 4 SKU-002596
2597 Pro Clothing Product Special Edition Clothing $427.95 450 3.7 238 SKU-002597
2598 Elite Sports & Outdoors Product Mini Sports & Outdoors $752.43 37 1.5 123 SKU-002598
2599 Ultra Clothing Product 2024 Clothing $559.37 480 2.3 855 SKU-002599
2601 Professional Office Supplies Product Plus Office Supplies $824.29 74 2.3 886 SKU-002601
2602 Super Sports & Outdoors Product XL Sports & Outdoors $693.72 369 3.7 55 SKU-002602
2603 Professional Electronics Product Advanced Electronics $112.71 497 1.6 504 SKU-002603
2604 Standard Electronics Product Classic Electronics $910.26 201 2.7 505 SKU-002604
2606 Elite Books Product Advanced Books $150.25 180 3.8 349 SKU-002606
2607 Pro Automotive Product Pro Automotive $204.06 87 2.6 834 SKU-002607
2609 Ultra Sports & Outdoors Product Classic Sports & Outdoors $308.62 191 2.2 368 SKU-002609
2610 Super Books Product Max Books $623.93 153 4.6 86 SKU-002610
2611 Premium Books Product Classic Books $867.78 151 3.6 779 SKU-002611
2613 Professional Automotive Product Pro Automotive $662.25 488 4.1 760 SKU-002613
2614 Pro Clothing Product Classic Clothing $414.19 309 2.9 303 SKU-002614
2615 Economy Sports & Outdoors Product Max Sports & Outdoors $979.41 78 4.8 718 SKU-002615
2616 Super Electronics Product Pro Electronics $117.87 384 1.1 414 SKU-002616
2617 Pro Toys & Games Product Pro Toys & Games $222.82 250 2.9 182 SKU-002617
2619 Economy Books Product Advanced Books $671.07 471 3.1 709 SKU-002619
2620 Standard Food & Grocery Product Pro Food & Grocery $285.55 4 3.2 356 SKU-002620
2621 Premium Automotive Product Mini Automotive $55.88 125 3.1 716 SKU-002621
2622 Standard Sports & Outdoors Product Pro Sports & Outdoors $295.56 111 4.3 19 SKU-002622
2623 Deluxe Sports & Outdoors Product Max Sports & Outdoors $850.66 381 2.2 745 SKU-002623
2624 Pro Health & Beauty Product Advanced Health & Beauty $718.83 1 4.7 667 SKU-002624
2625 Premium Electronics Product Advanced Electronics $877.59 339 4.8 410 SKU-002625
2627 Ultra Automotive Product Advanced Automotive $703.40 439 4.6 811 SKU-002627
2628 Economy Automotive Product Pro Automotive $506.45 472 1.8 351 SKU-002628
2629 Elite Toys & Games Product Lite Toys & Games $207.55 399 4.6 201 SKU-002629
2630 Mega Sports & Outdoors Product Classic Sports & Outdoors $187.97 460 4.9 130 SKU-002630
2631 Deluxe Clothing Product Advanced Clothing $185.64 176 4.6 761 SKU-002631
2632 Ultra Clothing Product Classic Clothing $797.13 290 2.5 555 SKU-002632
2633 Elite Health & Beauty Product Advanced Health & Beauty $243.38 345 4.9 270 SKU-002633
2634 Ultra Office Supplies Product XL Office Supplies $894.19 229 3.7 744 SKU-002634
2635 Deluxe Food & Grocery Product Pro Food & Grocery $818.24 286 4.7 213 SKU-002635
2636 Standard Electronics Product Advanced Electronics $801.45 91 4.7 554 SKU-002636
2637 Pro Home & Garden Product Advanced Home & Garden $434.23 429 4.5 688 SKU-002637
2638 Mega Clothing Product Advanced Clothing $372.13 71 4.3 3 SKU-002638
2639 Ultra Sports & Outdoors Product Special Edition Sports & Outdoors $442.73 382 2.1 965 SKU-002639
2640 Ultra Clothing Product Classic Clothing $954.55 177 4.0 415 SKU-002640
2641 Professional Clothing Product Lite Clothing $718.28 201 1.6 711 SKU-002641
2642 Mega Sports & Outdoors Product 2024 Sports & Outdoors $87.13 450 4.3 757 SKU-002642
2643 Economy Toys & Games Product 2024 Toys & Games $899.22 348 2.3 615 SKU-002643
2644 Pro Clothing Product Plus Clothing $242.47 81 2.3 714 SKU-002644
2645 Standard Electronics Product Special Edition Electronics $407.94 325 4.2 325 SKU-002645
2646 Professional Toys & Games Product Plus Toys & Games $82.49 89 2.0 632 SKU-002646
2647 Mega Automotive Product Advanced Automotive $542.02 106 1.7 657 SKU-002647
2648 Premium Health & Beauty Product Max Health & Beauty $128.56 242 2.4 814 SKU-002648
2649 Mega Automotive Product Special Edition Automotive $965.69 10 3.5 112 SKU-002649
2650 Pro Automotive Product Lite Automotive $347.47 170 2.1 663 SKU-002650
2651 Super Food & Grocery Product Special Edition Food & Grocery $64.40 403 2.2 29 SKU-002651
2652 Deluxe Automotive Product Special Edition Automotive $750.87 288 2.7 757 SKU-002652
2653 Super Electronics Product 2024 Electronics $810.86 369 2.6 662 SKU-002653
2654 Mega Food & Grocery Product Pro Food & Grocery $139.10 117 1.9 289 SKU-002654
2655 Super Automotive Product Plus Automotive $472.79 205 4.0 218 SKU-002655
2656 Pro Health & Beauty Product Lite Health & Beauty $866.04 332 1.2 180 SKU-002656
2657 Standard Clothing Product Max Clothing $620.41 376 3.4 788 SKU-002657
2658 Professional Automotive Product Special Edition Automotive $834.84 80 3.4 964 SKU-002658
2659 Ultra Food & Grocery Product Mini Food & Grocery $402.87 468 3.8 469 SKU-002659
2660 Economy Clothing Product XL Clothing $488.25 192 1.6 688 SKU-002660
2661 Professional Office Supplies Product Classic Office Supplies $910.74 301 3.3 661 SKU-002661
2662 Super Sports & Outdoors Product Pro Sports & Outdoors $249.76 211 2.7 184 SKU-002662
2663 Deluxe Home & Garden Product Advanced Home & Garden $801.64 11 5.0 446 SKU-002663
2665 Economy Home & Garden Product Mini Home & Garden $134.83 305 4.6 996 SKU-002665
2666 Deluxe Books Product Classic Books $600.35 434 2.7 636 SKU-002666
2667 Pro Food & Grocery Product Max Food & Grocery $610.00 150 2.3 216 SKU-002667
2668 Standard Home & Garden Product Special Edition Home & Garden $277.98 58 1.2 824 SKU-002668
2670 Ultra Home & Garden Product Mini Home & Garden $122.99 185 1.2 295 SKU-002670
2671 Elite Office Supplies Product Mini Office Supplies $135.26 106 4.0 968 SKU-002671
2672 Elite Automotive Product Plus Automotive $501.06 112 3.3 161 SKU-002672
2673 Super Electronics Product Pro Electronics $559.77 6 1.9 382 SKU-002673
2674 Elite Automotive Product Max Automotive $514.12 394 3.7 645 SKU-002674
2675 Deluxe Automotive Product Max Automotive $535.65 206 1.4 760 SKU-002675
2676 Super Health & Beauty Product Classic Health & Beauty $540.77 259 3.1 418 SKU-002676
2677 Economy Food & Grocery Product Plus Food & Grocery $489.01 107 3.5 993 SKU-002677
2678 Ultra Office Supplies Product Special Edition Office Supplies $47.63 49 2.9 239 SKU-002678
2679 Ultra Toys & Games Product Special Edition Toys & Games $241.06 124 1.2 407 SKU-002679
2680 Standard Toys & Games Product Advanced Toys & Games $697.23 474 2.0 15 SKU-002680
2682 Deluxe Automotive Product Advanced Automotive $220.89 107 4.0 317 SKU-002682
2683 Ultra Toys & Games Product 2024 Toys & Games $180.58 129 4.5 581 SKU-002683
2684 Super Clothing Product Lite Clothing $463.10 400 1.0 693 SKU-002684
2685 Professional Health & Beauty Product 2024 Health & Beauty $502.14 209 2.9 104 SKU-002685
2686 Mega Automotive Product Pro Automotive $92.02 443 3.3 363 SKU-002686
2688 Pro Home & Garden Product Classic Home & Garden $262.79 390 1.8 581 SKU-002688
2689 Standard Electronics Product Advanced Electronics $881.56 161 2.7 898 SKU-002689
2690 Standard Toys & Games Product Max Toys & Games $298.33 162 3.3 556 SKU-002690
2691 Professional Sports & Outdoors Product Pro Sports & Outdoors $586.09 335 1.2 563 SKU-002691
2692 Deluxe Sports & Outdoors Product Plus Sports & Outdoors $198.51 490 1.1 859 SKU-002692
2693 Ultra Office Supplies Product Max Office Supplies $77.34 22 3.0 477 SKU-002693
2694 Mega Health & Beauty Product Special Edition Health & Beauty $278.44 29 3.2 17 SKU-002694
2695 Pro Health & Beauty Product Advanced Health & Beauty $391.22 193 1.1 870 SKU-002695
2696 Mega Health & Beauty Product Lite Health & Beauty $508.43 2 1.5 757 SKU-002696
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