Efficient Pagination with Skip/Take

Efficient pagination using OFFSET-FETCH on SQL Server.

Execution Time

31 ms

Page Size

200

Current Page

21 / 123

Total Records

24441

Items per page: 25 50 100 200

Page 21 Results Showing 4001 - 4200 of 24441

ID Name Category Price Stock Rating Reviews SKU
4506 Super Sports & Outdoors Product Classic Sports & Outdoors $854.75 325 2.9 900 SKU-004506
4508 Mega Clothing Product XL Clothing $219.25 283 2.8 87 SKU-004508
4509 Pro Books Product 2024 Books $383.16 354 3.6 656 SKU-004509
4510 Mega Home & Garden Product Plus Home & Garden $80.15 73 4.3 636 SKU-004510
4511 Pro Toys & Games Product Advanced Toys & Games $12.99 128 2.1 991 SKU-004511
4512 Premium Books Product Plus Books $351.45 208 2.4 931 SKU-004512
4513 Standard Toys & Games Product XL Toys & Games $544.49 82 4.2 295 SKU-004513
4516 Ultra Home & Garden Product Max Home & Garden $12.19 33 3.7 792 SKU-004516
4517 Standard Electronics Product 2024 Electronics $21.91 146 4.3 724 SKU-004517
4518 Elite Food & Grocery Product Mini Food & Grocery $849.04 247 2.6 878 SKU-004518
4519 Elite Books Product 2024 Books $465.53 257 4.4 509 SKU-004519
4520 Elite Office Supplies Product Classic Office Supplies $768.85 342 2.8 983 SKU-004520
4521 Professional Home & Garden Product Max Home & Garden $927.03 280 1.1 332 SKU-004521
4522 Elite Electronics Product Lite Electronics $685.25 128 3.7 282 SKU-004522
4523 Pro Electronics Product Plus Electronics $921.84 304 3.9 422 SKU-004523
4525 Economy Books Product Plus Books $691.94 119 1.5 177 SKU-004525
4526 Mega Clothing Product 2024 Clothing $653.72 348 2.0 999 SKU-004526
4527 Economy Sports & Outdoors Product Classic Sports & Outdoors $378.70 267 3.5 932 SKU-004527
4528 Economy Toys & Games Product XL Toys & Games $787.78 495 2.5 937 SKU-004528
4529 Professional Health & Beauty Product Advanced Health & Beauty $861.38 494 4.4 726 SKU-004529
4530 Economy Clothing Product Advanced Clothing $959.89 329 2.4 280 SKU-004530
4531 Professional Office Supplies Product Max Office Supplies $750.21 486 3.9 244 SKU-004531
4532 Super Toys & Games Product Plus Toys & Games $370.31 98 2.8 31 SKU-004532
4533 Professional Home & Garden Product Special Edition Home & Garden $496.02 180 4.6 287 SKU-004533
4534 Ultra Automotive Product Mini Automotive $811.81 34 3.0 140 SKU-004534
4535 Elite Electronics Product Pro Electronics $939.77 80 2.0 902 SKU-004535
4537 Standard Automotive Product Max Automotive $442.02 363 3.6 254 SKU-004537
4539 Deluxe Books Product Mini Books $763.12 447 3.2 139 SKU-004539
4540 Standard Automotive Product Mini Automotive $634.34 363 4.3 617 SKU-004540
4542 Pro Sports & Outdoors Product XL Sports & Outdoors $972.27 176 4.6 565 SKU-004542
4543 Ultra Toys & Games Product Classic Toys & Games $900.60 247 3.0 560 SKU-004543
4544 Premium Health & Beauty Product 2024 Health & Beauty $775.39 91 1.2 708 SKU-004544
4545 Deluxe Toys & Games Product Lite Toys & Games $754.57 462 4.1 648 SKU-004545
4546 Mega Sports & Outdoors Product XL Sports & Outdoors $735.62 149 2.8 576 SKU-004546
4547 Premium Sports & Outdoors Product Mini Sports & Outdoors $350.24 47 3.5 879 SKU-004547
4548 Elite Clothing Product XL Clothing $770.18 163 1.8 425 SKU-004548
4549 Ultra Toys & Games Product Advanced Toys & Games $182.62 438 2.2 444 SKU-004549
4550 Super Automotive Product Lite Automotive $921.45 358 2.9 237 SKU-004550
4551 Ultra Health & Beauty Product Advanced Health & Beauty $875.94 468 4.1 831 SKU-004551
4552 Professional Home & Garden Product 2024 Home & Garden $249.85 390 2.2 391 SKU-004552
4553 Professional Sports & Outdoors Product Lite Sports & Outdoors $397.24 318 3.6 862 SKU-004553
4554 Economy Toys & Games Product Pro Toys & Games $295.02 271 3.4 58 SKU-004554
4555 Super Food & Grocery Product Max Food & Grocery $548.30 16 3.1 303 SKU-004555
4556 Premium Automotive Product Max Automotive $52.95 444 4.3 684 SKU-004556
4557 Mega Electronics Product XL Electronics $436.63 490 2.0 658 SKU-004557
4559 Ultra Home & Garden Product 2024 Home & Garden $44.52 192 4.6 229 SKU-004559
4561 Standard Sports & Outdoors Product Mini Sports & Outdoors $734.71 339 4.2 908 SKU-004561
4562 Economy Home & Garden Product XL Home & Garden $911.93 350 1.5 374 SKU-004562
4563 Premium Books Product 2024 Books $775.99 13 3.6 615 SKU-004563
4564 Economy Automotive Product Mini Automotive $52.90 228 4.4 357 SKU-004564
4566 Ultra Books Product Pro Books $529.90 321 4.0 0 SKU-004566
4567 Super Automotive Product Advanced Automotive $946.70 425 3.8 211 SKU-004567
4568 Pro Health & Beauty Product Mini Health & Beauty $889.20 196 1.4 609 SKU-004568
4569 Standard Books Product Plus Books $294.24 429 3.7 728 SKU-004569
4570 Deluxe Sports & Outdoors Product Special Edition Sports & Outdoors $708.87 173 3.2 851 SKU-004570
4571 Premium Electronics Product 2024 Electronics $271.77 333 4.1 169 SKU-004571
4572 Deluxe Sports & Outdoors Product Lite Sports & Outdoors $737.68 139 1.5 826 SKU-004572
4573 Mega Automotive Product Mini Automotive $922.91 170 2.6 937 SKU-004573
4574 Pro Electronics Product Lite Electronics $211.43 492 1.5 182 SKU-004574
4575 Premium Food & Grocery Product Plus Food & Grocery $883.44 273 3.8 856 SKU-004575
4576 Deluxe Electronics Product Special Edition Electronics $280.06 486 3.9 297 SKU-004576
4577 Deluxe Clothing Product Advanced Clothing $499.23 159 4.7 91 SKU-004577
4578 Standard Automotive Product Plus Automotive $520.27 233 1.9 174 SKU-004578
4579 Mega Books Product XL Books $879.12 48 4.6 656 SKU-004579
4580 Professional Sports & Outdoors Product Lite Sports & Outdoors $484.96 30 3.9 629 SKU-004580
4581 Standard Clothing Product Advanced Clothing $858.71 105 5.0 464 SKU-004581
4582 Mega Electronics Product 2024 Electronics $324.14 493 2.7 492 SKU-004582
4583 Standard Toys & Games Product Advanced Toys & Games $658.87 264 5.0 283 SKU-004583
4584 Pro Health & Beauty Product Lite Health & Beauty $468.98 220 2.9 313 SKU-004584
4585 Professional Sports & Outdoors Product Pro Sports & Outdoors $309.71 479 3.4 306 SKU-004585
4587 Professional Sports & Outdoors Product Max Sports & Outdoors $917.01 208 1.1 435 SKU-004587
4588 Pro Health & Beauty Product XL Health & Beauty $860.59 342 3.3 14 SKU-004588
4589 Premium Automotive Product Max Automotive $416.91 116 1.1 837 SKU-004589
4590 Economy Automotive Product Classic Automotive $818.26 81 3.7 702 SKU-004590
4592 Professional Health & Beauty Product Special Edition Health & Beauty $277.79 132 4.6 655 SKU-004592
4593 Ultra Electronics Product 2024 Electronics $679.52 463 3.6 616 SKU-004593
4594 Deluxe Electronics Product Pro Electronics $943.76 164 4.5 356 SKU-004594
4595 Ultra Automotive Product Advanced Automotive $561.09 440 5.0 579 SKU-004595
4596 Professional Electronics Product Plus Electronics $555.98 428 4.6 692 SKU-004596
4597 Elite Office Supplies Product Classic Office Supplies $567.04 211 4.2 715 SKU-004597
4598 Elite Food & Grocery Product Max Food & Grocery $669.80 486 1.1 624 SKU-004598
4599 Professional Sports & Outdoors Product Pro Sports & Outdoors $481.22 337 2.9 201 SKU-004599
4600 Super Toys & Games Product Special Edition Toys & Games $875.72 454 2.6 875 SKU-004600
4601 Ultra Food & Grocery Product Mini Food & Grocery $631.42 28 1.7 184 SKU-004601
4602 Super Toys & Games Product Classic Toys & Games $776.50 473 4.2 38 SKU-004602
4604 Standard Food & Grocery Product Plus Food & Grocery $622.71 147 3.7 532 SKU-004604
4605 Premium Sports & Outdoors Product Plus Sports & Outdoors $15.75 388 3.6 230 SKU-004605
4607 Deluxe Books Product Lite Books $222.92 283 2.5 35 SKU-004607
4608 Ultra Books Product Mini Books $19.31 388 4.1 68 SKU-004608
4609 Pro Home & Garden Product Pro Home & Garden $479.09 203 1.4 955 SKU-004609
4610 Deluxe Books Product Plus Books $624.17 457 1.1 334 SKU-004610
4611 Super Home & Garden Product Plus Home & Garden $419.35 50 1.7 744 SKU-004611
4612 Mega Sports & Outdoors Product Classic Sports & Outdoors $356.06 24 3.9 645 SKU-004612
4613 Pro Electronics Product Max Electronics $823.42 281 2.0 804 SKU-004613
4614 Ultra Books Product Special Edition Books $434.52 22 4.1 986 SKU-004614
4615 Pro Books Product XL Books $160.52 402 4.6 117 SKU-004615
4616 Super Sports & Outdoors Product Mini Sports & Outdoors $919.71 122 3.5 336 SKU-004616
4617 Ultra Automotive Product Mini Automotive $618.43 200 4.2 992 SKU-004617
4618 Deluxe Sports & Outdoors Product Plus Sports & Outdoors $808.07 254 2.3 17 SKU-004618
4620 Deluxe Clothing Product Pro Clothing $290.40 28 2.4 240 SKU-004620
4621 Ultra Electronics Product Max Electronics $744.26 428 4.9 613 SKU-004621
4622 Ultra Books Product Classic Books $752.05 129 1.1 3 SKU-004622
4623 Super Books Product Plus Books $599.91 370 4.4 243 SKU-004623
4624 Standard Office Supplies Product 2024 Office Supplies $609.00 319 3.0 430 SKU-004624
4625 Deluxe Food & Grocery Product Plus Food & Grocery $957.04 499 2.9 30 SKU-004625
4626 Professional Home & Garden Product Pro Home & Garden $469.36 480 3.6 487 SKU-004626
4627 Economy Home & Garden Product Plus Home & Garden $495.46 457 4.5 793 SKU-004627
4628 Pro Books Product Classic Books $21.48 382 4.9 997 SKU-004628
4629 Professional Toys & Games Product XL Toys & Games $39.29 138 3.9 757 SKU-004629
4631 Ultra Health & Beauty Product Mini Health & Beauty $847.20 135 4.7 640 SKU-004631
4632 Deluxe Sports & Outdoors Product Max Sports & Outdoors $353.37 355 3.7 535 SKU-004632
4633 Professional Automotive Product Pro Automotive $968.61 459 1.3 23 SKU-004633
4634 Standard Home & Garden Product Pro Home & Garden $521.08 329 4.7 169 SKU-004634
4635 Premium Clothing Product XL Clothing $470.75 155 2.3 640 SKU-004635
4636 Professional Electronics Product Special Edition Electronics $870.03 487 1.9 709 SKU-004636
4637 Premium Books Product Classic Books $825.85 465 3.2 986 SKU-004637
4638 Elite Office Supplies Product 2024 Office Supplies $481.55 56 3.7 282 SKU-004638
4639 Pro Books Product Plus Books $645.84 492 4.9 651 SKU-004639
4640 Elite Electronics Product Lite Electronics $175.72 227 1.1 356 SKU-004640
4641 Standard Health & Beauty Product Plus Health & Beauty $966.27 470 2.8 157 SKU-004641
4642 Professional Office Supplies Product Special Edition Office Supplies $165.23 332 1.4 835 SKU-004642
4643 Deluxe Electronics Product Advanced Electronics $84.22 278 2.6 782 SKU-004643
4644 Economy Health & Beauty Product XL Health & Beauty $968.32 300 3.3 899 SKU-004644
4646 Ultra Clothing Product Mini Clothing $692.59 57 1.4 251 SKU-004646
4647 Deluxe Toys & Games Product XL Toys & Games $16.29 320 1.5 41 SKU-004647
4648 Professional Office Supplies Product Plus Office Supplies $953.05 155 3.2 782 SKU-004648
4649 Super Food & Grocery Product Lite Food & Grocery $438.37 315 1.9 276 SKU-004649
4651 Mega Toys & Games Product Mini Toys & Games $196.04 483 2.6 698 SKU-004651
4653 Pro Health & Beauty Product Mini Health & Beauty $921.87 421 2.1 969 SKU-004653
4654 Economy Clothing Product Lite Clothing $525.52 20 2.6 788 SKU-004654
4655 Professional Clothing Product Lite Clothing $665.80 97 3.2 527 SKU-004655
4656 Mega Automotive Product Max Automotive $442.58 366 2.3 427 SKU-004656
4657 Standard Sports & Outdoors Product Special Edition Sports & Outdoors $241.27 332 3.1 882 SKU-004657
4658 Pro Sports & Outdoors Product Plus Sports & Outdoors $935.39 285 3.9 201 SKU-004658
4659 Mega Home & Garden Product Max Home & Garden $81.36 338 4.0 543 SKU-004659
4660 Economy Electronics Product Max Electronics $988.40 488 3.5 758 SKU-004660
4661 Mega Office Supplies Product XL Office Supplies $48.19 373 1.3 915 SKU-004661
4662 Premium Home & Garden Product Classic Home & Garden $886.31 496 3.2 320 SKU-004662
4663 Deluxe Electronics Product Pro Electronics $598.18 211 4.9 553 SKU-004663
4664 Standard Automotive Product Pro Automotive $959.37 469 3.5 500 SKU-004664
4665 Pro Electronics Product Special Edition Electronics $878.06 388 4.7 269 SKU-004665
4666 Standard Books Product Special Edition Books $915.13 21 2.0 876 SKU-004666
4667 Pro Toys & Games Product Mini Toys & Games $215.76 81 2.1 114 SKU-004667
4668 Pro Sports & Outdoors Product Pro Sports & Outdoors $121.65 484 2.6 36 SKU-004668
4669 Standard Home & Garden Product Mini Home & Garden $455.25 253 2.9 9 SKU-004669
4671 Economy Books Product XL Books $122.65 476 1.2 814 SKU-004671
4672 Deluxe Clothing Product XL Clothing $807.10 473 4.1 303 SKU-004672
4673 Elite Office Supplies Product Pro Office Supplies $336.37 79 2.4 552 SKU-004673
4674 Ultra Health & Beauty Product Special Edition Health & Beauty $622.29 234 2.3 247 SKU-004674
4675 Super Clothing Product Pro Clothing $732.23 110 3.1 564 SKU-004675
4676 Ultra Toys & Games Product Max Toys & Games $536.70 490 1.5 892 SKU-004676
4677 Standard Electronics Product Mini Electronics $424.30 460 3.9 639 SKU-004677
4679 Deluxe Home & Garden Product Mini Home & Garden $657.40 497 2.4 349 SKU-004679
4680 Pro Sports & Outdoors Product Mini Sports & Outdoors $794.74 445 1.4 297 SKU-004680
4681 Professional Electronics Product Special Edition Electronics $388.22 258 4.9 255 SKU-004681
4682 Standard Home & Garden Product Special Edition Home & Garden $905.29 76 3.0 411 SKU-004682
4683 Deluxe Toys & Games Product Classic Toys & Games $612.22 497 1.2 205 SKU-004683
4684 Mega Electronics Product Mini Electronics $643.04 453 3.3 367 SKU-004684
4686 Super Automotive Product Classic Automotive $11.08 415 1.5 700 SKU-004686
4687 Deluxe Food & Grocery Product Mini Food & Grocery $272.28 282 4.6 418 SKU-004687
4688 Ultra Sports & Outdoors Product Advanced Sports & Outdoors $741.61 462 2.1 452 SKU-004688
4689 Ultra Health & Beauty Product XL Health & Beauty $212.12 29 4.4 701 SKU-004689
4690 Pro Home & Garden Product Advanced Home & Garden $807.14 151 4.8 791 SKU-004690
4691 Economy Electronics Product Special Edition Electronics $483.76 438 3.3 222 SKU-004691
4692 Deluxe Health & Beauty Product Plus Health & Beauty $908.80 480 1.9 622 SKU-004692
4693 Super Sports & Outdoors Product Advanced Sports & Outdoors $193.86 156 4.4 145 SKU-004693
4695 Deluxe Books Product Advanced Books $667.75 108 2.3 443 SKU-004695
4696 Pro Automotive Product Advanced Automotive $246.32 286 2.1 498 SKU-004696
4697 Standard Food & Grocery Product Advanced Food & Grocery $445.26 230 4.4 496 SKU-004697
4698 Deluxe Health & Beauty Product 2024 Health & Beauty $555.21 248 4.1 817 SKU-004698
4700 Deluxe Office Supplies Product Lite Office Supplies $31.56 476 3.0 357 SKU-004700
4701 Elite Automotive Product Special Edition Automotive $895.55 294 3.3 673 SKU-004701
4702 Mega Books Product Mini Books $408.83 218 3.7 149 SKU-004702
4704 Deluxe Books Product XL Books $31.82 469 3.5 289 SKU-004704
4705 Economy Books Product 2024 Books $915.14 310 1.0 942 SKU-004705
4706 Super Sports & Outdoors Product Special Edition Sports & Outdoors $602.19 450 3.8 3 SKU-004706
4707 Standard Sports & Outdoors Product Lite Sports & Outdoors $189.82 494 2.1 192 SKU-004707
4708 Premium Sports & Outdoors Product Lite Sports & Outdoors $840.01 273 3.7 821 SKU-004708
4709 Mega Toys & Games Product Max Toys & Games $125.26 201 1.1 29 SKU-004709
4710 Professional Office Supplies Product Advanced Office Supplies $149.69 308 3.2 899 SKU-004710
4711 Mega Home & Garden Product Lite Home & Garden $221.93 470 2.2 740 SKU-004711
4712 Premium Food & Grocery Product Pro Food & Grocery $396.46 209 4.1 517 SKU-004712
4713 Premium Food & Grocery Product Pro Food & Grocery $972.70 181 4.7 215 SKU-004713
4714 Pro Office Supplies Product Pro Office Supplies $986.02 462 1.0 942 SKU-004714
4716 Pro Toys & Games Product Classic Toys & Games $678.48 248 1.2 80 SKU-004716
4718 Deluxe Clothing Product Lite Clothing $659.70 471 4.8 852 SKU-004718
4719 Super Electronics Product Advanced Electronics $766.67 304 4.3 787 SKU-004719
4720 Pro Sports & Outdoors Product Advanced Sports & Outdoors $600.06 2 1.2 547 SKU-004720
4721 Super Electronics Product Max Electronics $176.69 175 4.4 941 SKU-004721
4722 Professional Food & Grocery Product Lite Food & Grocery $557.52 180 1.8 477 SKU-004722
4723 Ultra Toys & Games Product Classic Toys & Games $125.70 23 4.3 633 SKU-004723
4724 Ultra Automotive Product Mini Automotive $546.81 227 3.9 122 SKU-004724
4726 Deluxe Home & Garden Product XL Home & Garden $587.04 89 4.1 184 SKU-004726
4727 Pro Sports & Outdoors Product 2024 Sports & Outdoors $646.41 486 3.0 905 SKU-004727
4729 Professional Toys & Games Product Special Edition Toys & Games $789.85 26 3.5 209 SKU-004729
4730 Pro Clothing Product 2024 Clothing $258.54 440 4.8 500 SKU-004730
4733 Deluxe Home & Garden Product Lite Home & Garden $312.34 270 1.3 887 SKU-004733
4734 Professional Home & Garden Product Lite Home & Garden $84.19 375 3.8 849 SKU-004734
4735 Mega Books Product Special Edition Books $112.97 435 2.1 158 SKU-004735
4737 Deluxe Sports & Outdoors Product Mini Sports & Outdoors $863.24 279 1.3 91 SKU-004737
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