Efficient Pagination with Skip/Take

Efficient pagination using OFFSET-FETCH on SQL Server.

Execution Time

13 ms

Page Size

200

Current Page

16 / 123

Total Records

24441

Items per page: 25 50 100 200

Page 16 Results Showing 3001 - 3200 of 24441

ID Name Category Price Stock Rating Reviews SKU
3367 Ultra Clothing Product Max Clothing $210.00 276 4.3 38 SKU-003367
3368 Ultra Electronics Product Special Edition Electronics $700.10 435 4.1 476 SKU-003368
3369 Deluxe Home & Garden Product XL Home & Garden $13.16 193 2.8 612 SKU-003369
3370 Pro Electronics Product Special Edition Electronics $973.64 360 3.6 670 SKU-003370
3371 Ultra Electronics Product Plus Electronics $797.83 12 4.3 434 SKU-003371
3372 Elite Electronics Product Lite Electronics $388.91 91 1.7 555 SKU-003372
3373 Pro Food & Grocery Product Mini Food & Grocery $327.71 254 1.7 575 SKU-003373
3374 Professional Toys & Games Product Plus Toys & Games $757.28 237 4.6 34 SKU-003374
3375 Ultra Food & Grocery Product Lite Food & Grocery $835.62 153 3.6 760 SKU-003375
3376 Ultra Health & Beauty Product 2024 Health & Beauty $828.74 378 1.0 507 SKU-003376
3377 Premium Clothing Product Max Clothing $461.72 422 5.0 513 SKU-003377
3378 Ultra Home & Garden Product Max Home & Garden $37.43 67 4.5 276 SKU-003378
3379 Premium Books Product Special Edition Books $81.48 253 2.8 251 SKU-003379
3381 Pro Toys & Games Product Plus Toys & Games $472.58 206 3.9 73 SKU-003381
3382 Professional Health & Beauty Product Classic Health & Beauty $654.02 169 3.2 862 SKU-003382
3384 Deluxe Health & Beauty Product Special Edition Health & Beauty $954.73 148 4.6 459 SKU-003384
3385 Deluxe Home & Garden Product 2024 Home & Garden $31.50 298 3.2 75 SKU-003385
3386 Professional Toys & Games Product Advanced Toys & Games $231.46 461 4.5 717 SKU-003386
3388 Professional Books Product 2024 Books $79.17 342 1.0 268 SKU-003388
3389 Elite Home & Garden Product Special Edition Home & Garden $676.62 317 2.3 497 SKU-003389
3390 Mega Books Product 2024 Books $927.19 95 1.7 218 SKU-003390
3391 Mega Food & Grocery Product Special Edition Food & Grocery $575.99 182 1.1 719 SKU-003391
3392 Premium Books Product Mini Books $327.98 384 2.0 420 SKU-003392
3393 Standard Home & Garden Product Plus Home & Garden $479.31 44 2.7 781 SKU-003393
3394 Ultra Automotive Product Advanced Automotive $14.54 368 1.2 415 SKU-003394
3395 Super Clothing Product Max Clothing $969.81 24 3.8 38 SKU-003395
3396 Elite Toys & Games Product 2024 Toys & Games $394.20 327 2.5 458 SKU-003396
3397 Pro Office Supplies Product Plus Office Supplies $987.04 459 3.2 722 SKU-003397
3398 Mega Office Supplies Product Plus Office Supplies $584.67 488 3.7 702 SKU-003398
3399 Ultra Electronics Product Max Electronics $307.91 387 4.5 719 SKU-003399
3400 Premium Toys & Games Product Plus Toys & Games $709.27 144 3.7 653 SKU-003400
3401 Elite Office Supplies Product Special Edition Office Supplies $148.44 311 1.2 990 SKU-003401
3404 Ultra Toys & Games Product Max Toys & Games $138.07 109 4.4 220 SKU-003404
3406 Pro Home & Garden Product XL Home & Garden $124.96 442 1.1 51 SKU-003406
3407 Mega Toys & Games Product Advanced Toys & Games $257.79 437 4.3 943 SKU-003407
3410 Deluxe Electronics Product Advanced Electronics $17.73 246 4.8 836 SKU-003410
3411 Pro Food & Grocery Product Pro Food & Grocery $218.35 190 3.1 162 SKU-003411
3412 Ultra Health & Beauty Product Special Edition Health & Beauty $868.72 70 2.5 239 SKU-003412
3413 Mega Health & Beauty Product Special Edition Health & Beauty $823.92 349 3.7 14 SKU-003413
3414 Elite Electronics Product 2024 Electronics $139.59 62 4.0 971 SKU-003414
3415 Standard Sports & Outdoors Product Pro Sports & Outdoors $71.98 322 1.8 115 SKU-003415
3416 Economy Health & Beauty Product Max Health & Beauty $670.45 438 3.1 351 SKU-003416
3417 Ultra Clothing Product Pro Clothing $674.28 481 3.6 178 SKU-003417
3418 Ultra Electronics Product Plus Electronics $718.30 332 3.0 527 SKU-003418
3419 Professional Automotive Product Classic Automotive $744.41 138 3.1 129 SKU-003419
3420 Premium Office Supplies Product Special Edition Office Supplies $256.74 87 2.5 743 SKU-003420
3421 Premium Food & Grocery Product 2024 Food & Grocery $61.62 82 4.1 710 SKU-003421
3422 Super Automotive Product XL Automotive $547.50 376 2.2 576 SKU-003422
3423 Premium Automotive Product Max Automotive $276.13 135 4.7 339 SKU-003423
3425 Economy Sports & Outdoors Product Plus Sports & Outdoors $91.31 487 1.9 381 SKU-003425
3426 Premium Toys & Games Product XL Toys & Games $731.48 426 4.5 276 SKU-003426
3427 Standard Office Supplies Product XL Office Supplies $748.23 294 4.8 636 SKU-003427
3428 Elite Books Product Lite Books $970.99 436 3.8 540 SKU-003428
3429 Premium Clothing Product 2024 Clothing $125.53 110 2.8 176 SKU-003429
3430 Super Sports & Outdoors Product Max Sports & Outdoors $551.07 431 3.6 108 SKU-003430
3431 Pro Office Supplies Product Mini Office Supplies $36.03 492 1.7 371 SKU-003431
3432 Premium Office Supplies Product Advanced Office Supplies $878.41 198 3.9 863 SKU-003432
3433 Deluxe Health & Beauty Product Pro Health & Beauty $719.54 494 1.8 24 SKU-003433
3434 Deluxe Home & Garden Product XL Home & Garden $112.98 279 5.0 444 SKU-003434
3435 Elite Electronics Product Pro Electronics $323.41 395 2.0 592 SKU-003435
3436 Standard Food & Grocery Product Classic Food & Grocery $444.17 312 4.0 919 SKU-003436
3437 Super Health & Beauty Product Advanced Health & Beauty $562.28 84 4.1 948 SKU-003437
3438 Standard Food & Grocery Product Max Food & Grocery $611.03 194 3.4 203 SKU-003438
3440 Standard Toys & Games Product 2024 Toys & Games $344.00 125 3.9 307 SKU-003440
3441 Ultra Clothing Product Mini Clothing $943.19 285 3.0 320 SKU-003441
3442 Mega Books Product Pro Books $943.74 329 1.8 355 SKU-003442
3444 Standard Health & Beauty Product Mini Health & Beauty $568.71 127 3.4 674 SKU-003444
3446 Super Electronics Product Classic Electronics $779.68 246 1.8 251 SKU-003446
3448 Economy Food & Grocery Product Max Food & Grocery $326.45 448 4.7 804 SKU-003448
3449 Ultra Automotive Product Special Edition Automotive $228.49 261 1.6 137 SKU-003449
3450 Economy Clothing Product Advanced Clothing $795.51 451 2.3 272 SKU-003450
3451 Professional Office Supplies Product Pro Office Supplies $966.79 222 3.2 324 SKU-003451
3452 Mega Home & Garden Product Max Home & Garden $471.76 232 2.5 561 SKU-003452
3453 Economy Automotive Product Special Edition Automotive $773.13 4 2.3 186 SKU-003453
3454 Economy Health & Beauty Product XL Health & Beauty $96.12 451 2.4 505 SKU-003454
3455 Standard Books Product XL Books $48.06 299 4.8 271 SKU-003455
3456 Mega Health & Beauty Product Pro Health & Beauty $806.16 360 3.5 967 SKU-003456
3457 Pro Food & Grocery Product Pro Food & Grocery $469.60 96 1.5 476 SKU-003457
3458 Mega Health & Beauty Product Lite Health & Beauty $427.77 367 4.4 520 SKU-003458
3459 Premium Food & Grocery Product Lite Food & Grocery $376.59 289 4.6 464 SKU-003459
3460 Premium Health & Beauty Product Plus Health & Beauty $102.43 274 4.3 557 SKU-003460
3461 Deluxe Books Product Classic Books $371.28 89 4.6 844 SKU-003461
3462 Economy Health & Beauty Product 2024 Health & Beauty $31.25 216 3.8 398 SKU-003462
3463 Elite Health & Beauty Product Pro Health & Beauty $223.13 109 2.8 427 SKU-003463
3464 Deluxe Sports & Outdoors Product 2024 Sports & Outdoors $356.86 270 2.3 339 SKU-003464
3465 Premium Electronics Product Pro Electronics $939.15 357 1.2 898 SKU-003465
3466 Deluxe Toys & Games Product Advanced Toys & Games $933.88 392 3.1 64 SKU-003466
3467 Elite Sports & Outdoors Product Advanced Sports & Outdoors $383.95 102 4.0 106 SKU-003467
3468 Ultra Toys & Games Product Lite Toys & Games $72.49 181 3.8 66 SKU-003468
3469 Elite Electronics Product Max Electronics $256.52 276 4.9 305 SKU-003469
3470 Professional Food & Grocery Product Classic Food & Grocery $370.12 228 3.5 174 SKU-003470
3471 Professional Books Product Mini Books $740.08 360 4.9 52 SKU-003471
3472 Super Toys & Games Product Plus Toys & Games $437.88 356 1.4 530 SKU-003472
3473 Elite Clothing Product Max Clothing $614.29 6 1.4 762 SKU-003473
3474 Pro Health & Beauty Product Special Edition Health & Beauty $460.30 321 3.7 573 SKU-003474
3475 Mega Food & Grocery Product Special Edition Food & Grocery $866.32 96 5.0 965 SKU-003475
3476 Ultra Office Supplies Product Classic Office Supplies $965.40 95 4.2 511 SKU-003476
3477 Pro Health & Beauty Product Advanced Health & Beauty $937.95 399 3.6 524 SKU-003477
3478 Economy Home & Garden Product Pro Home & Garden $554.98 129 2.0 858 SKU-003478
3479 Ultra Toys & Games Product Mini Toys & Games $422.72 124 3.8 129 SKU-003479
3480 Standard Toys & Games Product Lite Toys & Games $843.31 110 3.6 492 SKU-003480
3482 Standard Office Supplies Product 2024 Office Supplies $405.56 5 3.3 420 SKU-003482
3483 Ultra Sports & Outdoors Product Lite Sports & Outdoors $783.62 474 2.2 109 SKU-003483
3484 Mega Health & Beauty Product Pro Health & Beauty $982.01 43 2.6 383 SKU-003484
3485 Premium Sports & Outdoors Product Pro Sports & Outdoors $32.08 124 1.5 687 SKU-003485
3486 Elite Office Supplies Product Lite Office Supplies $108.93 124 1.3 449 SKU-003486
3487 Super Home & Garden Product Special Edition Home & Garden $790.90 83 4.1 794 SKU-003487
3488 Elite Books Product Pro Books $45.71 70 4.8 762 SKU-003488
3490 Economy Office Supplies Product Plus Office Supplies $177.00 143 4.9 798 SKU-003490
3491 Economy Health & Beauty Product Mini Health & Beauty $314.44 285 3.4 751 SKU-003491
3492 Ultra Automotive Product Special Edition Automotive $319.43 496 1.5 437 SKU-003492
3493 Super Food & Grocery Product Special Edition Food & Grocery $199.80 144 2.8 210 SKU-003493
3494 Standard Toys & Games Product Classic Toys & Games $707.06 19 1.6 349 SKU-003494
3495 Elite Sports & Outdoors Product 2024 Sports & Outdoors $26.96 493 1.3 852 SKU-003495
3496 Super Home & Garden Product 2024 Home & Garden $590.14 491 2.3 731 SKU-003496
3497 Professional Home & Garden Product Pro Home & Garden $930.75 262 4.9 16 SKU-003497
3498 Ultra Health & Beauty Product Lite Health & Beauty $307.67 340 3.7 312 SKU-003498
3499 Standard Home & Garden Product XL Home & Garden $765.34 259 2.3 231 SKU-003499
3500 Elite Toys & Games Product Advanced Toys & Games $558.33 428 4.3 227 SKU-003500
3501 Elite Health & Beauty Product XL Health & Beauty $26.45 78 2.3 693 SKU-003501
3503 Premium Sports & Outdoors Product Advanced Sports & Outdoors $185.33 159 3.4 906 SKU-003503
3505 Premium Clothing Product Lite Clothing $65.71 199 3.8 399 SKU-003505
3506 Ultra Clothing Product Mini Clothing $699.15 112 2.6 925 SKU-003506
3507 Mega Food & Grocery Product Special Edition Food & Grocery $937.36 21 1.2 917 SKU-003507
3508 Premium Books Product 2024 Books $955.50 78 2.5 194 SKU-003508
3509 Economy Health & Beauty Product Max Health & Beauty $136.42 161 2.8 914 SKU-003509
3510 Super Office Supplies Product Max Office Supplies $95.92 409 1.2 472 SKU-003510
3511 Deluxe Toys & Games Product Classic Toys & Games $942.15 277 1.5 505 SKU-003511
3512 Premium Clothing Product Lite Clothing $809.09 15 3.7 298 SKU-003512
3514 Elite Home & Garden Product Max Home & Garden $741.43 97 3.1 459 SKU-003514
3515 Elite Books Product Mini Books $201.05 289 1.5 773 SKU-003515
3516 Standard Home & Garden Product 2024 Home & Garden $542.22 310 4.6 259 SKU-003516
3517 Standard Electronics Product Max Electronics $826.60 151 2.3 737 SKU-003517
3518 Elite Sports & Outdoors Product Plus Sports & Outdoors $516.35 408 3.7 969 SKU-003518
3519 Mega Office Supplies Product Mini Office Supplies $251.91 480 4.0 718 SKU-003519
3520 Elite Office Supplies Product Pro Office Supplies $297.06 201 1.2 272 SKU-003520
3521 Mega Toys & Games Product Mini Toys & Games $12.63 480 1.6 924 SKU-003521
3522 Deluxe Automotive Product Mini Automotive $588.25 457 3.7 474 SKU-003522
3523 Standard Office Supplies Product 2024 Office Supplies $582.69 84 2.0 416 SKU-003523
3524 Mega Electronics Product Mini Electronics $40.37 100 4.1 26 SKU-003524
3525 Elite Electronics Product Advanced Electronics $229.00 472 3.5 213 SKU-003525
3527 Elite Electronics Product Max Electronics $666.67 303 3.9 332 SKU-003527
3528 Professional Food & Grocery Product Advanced Food & Grocery $251.57 259 2.7 117 SKU-003528
3529 Pro Sports & Outdoors Product Plus Sports & Outdoors $159.53 161 1.8 953 SKU-003529
3530 Ultra Automotive Product Mini Automotive $948.04 435 2.7 248 SKU-003530
3531 Elite Toys & Games Product 2024 Toys & Games $867.64 291 4.2 338 SKU-003531
3532 Mega Food & Grocery Product Mini Food & Grocery $655.72 89 3.8 983 SKU-003532
3533 Mega Toys & Games Product Lite Toys & Games $621.40 251 2.4 918 SKU-003533
3535 Economy Electronics Product Advanced Electronics $332.35 396 3.0 870 SKU-003535
3536 Super Sports & Outdoors Product 2024 Sports & Outdoors $437.86 94 1.9 467 SKU-003536
3537 Pro Home & Garden Product Plus Home & Garden $27.27 440 3.7 89 SKU-003537
3540 Ultra Electronics Product Plus Electronics $791.53 128 2.9 609 SKU-003540
3541 Premium Toys & Games Product Classic Toys & Games $112.54 192 3.7 214 SKU-003541
3542 Deluxe Food & Grocery Product Classic Food & Grocery $802.77 293 4.5 30 SKU-003542
3543 Pro Books Product Max Books $881.00 109 3.5 465 SKU-003543
3545 Economy Automotive Product Pro Automotive $814.63 145 1.8 250 SKU-003545
3546 Deluxe Books Product Pro Books $833.38 289 1.3 366 SKU-003546
3547 Deluxe Sports & Outdoors Product Mini Sports & Outdoors $737.10 395 1.2 910 SKU-003547
3548 Standard Sports & Outdoors Product Pro Sports & Outdoors $664.90 206 2.4 630 SKU-003548
3550 Economy Home & Garden Product Plus Home & Garden $37.86 298 3.6 708 SKU-003550
3551 Economy Clothing Product Special Edition Clothing $380.03 69 3.5 18 SKU-003551
3552 Ultra Electronics Product 2024 Electronics $716.92 60 2.1 580 SKU-003552
3553 Standard Electronics Product Mini Electronics $995.75 213 4.9 426 SKU-003553
3554 Economy Health & Beauty Product Plus Health & Beauty $111.52 261 1.9 515 SKU-003554
3555 Economy Automotive Product Mini Automotive $698.46 373 4.5 77 SKU-003555
3557 Pro Automotive Product Mini Automotive $101.87 172 3.1 540 SKU-003557
3558 Mega Electronics Product Mini Electronics $231.75 390 4.1 119 SKU-003558
3559 Premium Office Supplies Product Plus Office Supplies $272.16 374 2.4 896 SKU-003559
3560 Elite Office Supplies Product Mini Office Supplies $337.84 156 3.8 758 SKU-003560
3561 Elite Health & Beauty Product Max Health & Beauty $791.18 443 4.2 978 SKU-003561
3562 Economy Sports & Outdoors Product XL Sports & Outdoors $487.21 491 3.8 553 SKU-003562
3563 Ultra Sports & Outdoors Product Pro Sports & Outdoors $98.76 237 2.5 71 SKU-003563
3564 Elite Books Product XL Books $491.55 467 2.9 243 SKU-003564
3565 Standard Automotive Product Pro Automotive $743.88 32 4.0 659 SKU-003565
3566 Economy Clothing Product Max Clothing $279.55 273 2.8 584 SKU-003566
3567 Economy Office Supplies Product Pro Office Supplies $152.83 59 4.9 412 SKU-003567
3568 Super Sports & Outdoors Product Max Sports & Outdoors $70.02 202 2.8 841 SKU-003568
3569 Mega Toys & Games Product Pro Toys & Games $656.00 79 5.0 360 SKU-003569
3570 Pro Sports & Outdoors Product Classic Sports & Outdoors $399.41 241 4.2 475 SKU-003570
3571 Ultra Books Product XL Books $449.33 111 2.4 758 SKU-003571
3572 Elite Home & Garden Product Max Home & Garden $248.84 420 2.4 596 SKU-003572
3573 Premium Clothing Product 2024 Clothing $35.69 164 2.2 525 SKU-003573
3574 Economy Office Supplies Product Mini Office Supplies $108.38 423 4.0 219 SKU-003574
3576 Super Electronics Product Classic Electronics $500.67 254 2.8 459 SKU-003576
3578 Deluxe Toys & Games Product Advanced Toys & Games $40.79 467 1.2 36 SKU-003578
3579 Elite Books Product XL Books $575.81 468 1.1 94 SKU-003579
3580 Ultra Office Supplies Product Pro Office Supplies $716.57 472 1.6 13 SKU-003580
3581 Standard Electronics Product Pro Electronics $396.28 437 1.5 525 SKU-003581
3582 Pro Automotive Product Max Automotive $684.70 39 1.9 856 SKU-003582
3583 Deluxe Clothing Product Special Edition Clothing $228.56 267 4.9 177 SKU-003583
3585 Mega Electronics Product Special Edition Electronics $496.06 163 1.3 742 SKU-003585
3586 Ultra Health & Beauty Product Mini Health & Beauty $209.07 50 2.8 315 SKU-003586
3587 Mega Food & Grocery Product Pro Food & Grocery $129.25 70 4.1 766 SKU-003587
3588 Deluxe Automotive Product Special Edition Automotive $358.74 226 2.6 340 SKU-003588
3589 Pro Home & Garden Product Mini Home & Garden $605.53 353 4.8 999 SKU-003589
3590 Super Toys & Games Product Lite Toys & Games $365.61 92 2.3 686 SKU-003590
3591 Professional Health & Beauty Product Mini Health & Beauty $378.04 438 1.0 219 SKU-003591
3592 Pro Clothing Product Special Edition Clothing $33.22 265 1.8 85 SKU-003592
3594 Economy Clothing Product Classic Clothing $998.34 497 3.8 350 SKU-003594
3595 Economy Electronics Product Classic Electronics $758.68 181 3.4 841 SKU-003595
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