Efficient Pagination with Skip/Take

Efficient pagination using OFFSET-FETCH on SQL Server.

Execution Time

17 ms

Page Size

200

Current Page

15 / 123

Total Records

24441

Items per page: 25 50 100 200

Page 15 Results Showing 2801 - 3000 of 24441

ID Name Category Price Stock Rating Reviews SKU
3137 Premium Sports & Outdoors Product Mini Sports & Outdoors $623.72 498 2.2 532 SKU-003137
3138 Super Health & Beauty Product XL Health & Beauty $119.44 363 1.8 51 SKU-003138
3139 Standard Food & Grocery Product Max Food & Grocery $328.28 428 1.4 725 SKU-003139
3140 Elite Books Product XL Books $508.17 320 4.1 572 SKU-003140
3141 Pro Home & Garden Product Max Home & Garden $545.09 245 4.4 178 SKU-003141
3142 Pro Books Product Plus Books $872.00 195 4.1 530 SKU-003142
3143 Economy Toys & Games Product Lite Toys & Games $236.86 325 4.5 208 SKU-003143
3144 Mega Books Product Classic Books $892.53 174 1.4 440 SKU-003144
3145 Economy Automotive Product 2024 Automotive $348.59 93 1.5 569 SKU-003145
3146 Mega Office Supplies Product Advanced Office Supplies $267.68 173 2.2 323 SKU-003146
3147 Deluxe Automotive Product Advanced Automotive $56.13 288 2.3 552 SKU-003147
3148 Standard Toys & Games Product 2024 Toys & Games $366.75 52 1.7 997 SKU-003148
3149 Super Clothing Product Max Clothing $356.19 393 2.7 156 SKU-003149
3150 Economy Home & Garden Product Lite Home & Garden $16.92 212 3.1 928 SKU-003150
3151 Elite Sports & Outdoors Product Special Edition Sports & Outdoors $827.54 276 3.7 184 SKU-003151
3152 Ultra Toys & Games Product 2024 Toys & Games $66.89 491 4.3 290 SKU-003152
3154 Economy Home & Garden Product Lite Home & Garden $756.12 432 2.2 432 SKU-003154
3155 Deluxe Clothing Product Pro Clothing $964.45 320 2.4 583 SKU-003155
3156 Economy Food & Grocery Product Max Food & Grocery $761.03 488 3.7 623 SKU-003156
3157 Professional Books Product Pro Books $509.56 480 4.8 407 SKU-003157
3158 Super Electronics Product Mini Electronics $561.67 266 1.3 493 SKU-003158
3159 Economy Electronics Product Classic Electronics $316.20 444 4.7 579 SKU-003159
3160 Ultra Electronics Product Special Edition Electronics $170.54 172 2.7 852 SKU-003160
3161 Economy Health & Beauty Product Classic Health & Beauty $324.79 188 4.1 762 SKU-003161
3162 Economy Clothing Product Lite Clothing $333.38 241 3.3 624 SKU-003162
3163 Economy Office Supplies Product Plus Office Supplies $24.19 66 3.2 682 SKU-003163
3164 Super Clothing Product Lite Clothing $537.36 221 2.3 590 SKU-003164
3165 Standard Automotive Product Mini Automotive $755.72 474 2.5 561 SKU-003165
3166 Mega Food & Grocery Product XL Food & Grocery $41.48 42 1.1 69 SKU-003166
3168 Mega Office Supplies Product Advanced Office Supplies $525.35 290 1.3 15 SKU-003168
3169 Premium Automotive Product Max Automotive $539.95 465 1.7 511 SKU-003169
3171 Economy Health & Beauty Product Advanced Health & Beauty $510.65 220 4.9 996 SKU-003171
3172 Ultra Health & Beauty Product Pro Health & Beauty $605.06 58 1.9 748 SKU-003172
3173 Standard Clothing Product Mini Clothing $526.00 158 1.5 734 SKU-003173
3174 Standard Sports & Outdoors Product Plus Sports & Outdoors $54.27 435 2.2 686 SKU-003174
3175 Pro Toys & Games Product Special Edition Toys & Games $854.95 133 1.3 569 SKU-003175
3176 Pro Clothing Product Advanced Clothing $93.44 265 3.8 232 SKU-003176
3177 Pro Electronics Product Max Electronics $375.04 442 2.2 810 SKU-003177
3178 Mega Clothing Product Plus Clothing $394.64 258 4.4 355 SKU-003178
3179 Mega Books Product XL Books $338.31 262 4.9 425 SKU-003179
3181 Elite Office Supplies Product 2024 Office Supplies $937.63 318 1.7 351 SKU-003181
3182 Pro Home & Garden Product 2024 Home & Garden $677.76 221 1.2 342 SKU-003182
3183 Deluxe Office Supplies Product Plus Office Supplies $202.10 11 4.8 233 SKU-003183
3184 Super Sports & Outdoors Product Max Sports & Outdoors $31.08 445 4.6 924 SKU-003184
3185 Ultra Electronics Product Plus Electronics $390.77 362 2.5 49 SKU-003185
3186 Economy Electronics Product Max Electronics $81.20 94 4.5 939 SKU-003186
3187 Super Automotive Product 2024 Automotive $570.45 200 4.8 410 SKU-003187
3188 Super Sports & Outdoors Product XL Sports & Outdoors $513.43 37 1.8 886 SKU-003188
3190 Economy Books Product Pro Books $714.65 331 3.5 168 SKU-003190
3192 Standard Automotive Product Mini Automotive $534.58 291 4.2 407 SKU-003192
3193 Standard Electronics Product Lite Electronics $659.93 383 4.3 381 SKU-003193
3194 Ultra Electronics Product Lite Electronics $913.01 244 3.8 856 SKU-003194
3195 Pro Food & Grocery Product XL Food & Grocery $327.33 349 2.9 920 SKU-003195
3196 Elite Automotive Product Advanced Automotive $287.45 427 1.9 999 SKU-003196
3197 Ultra Toys & Games Product Lite Toys & Games $855.91 335 1.9 785 SKU-003197
3198 Super Health & Beauty Product XL Health & Beauty $714.10 432 3.9 969 SKU-003198
3199 Standard Clothing Product Special Edition Clothing $812.44 422 3.6 891 SKU-003199
3200 Professional Health & Beauty Product Mini Health & Beauty $739.82 296 4.8 92 SKU-003200
3201 Professional Automotive Product Pro Automotive $232.77 473 4.6 49 SKU-003201
3203 Elite Sports & Outdoors Product 2024 Sports & Outdoors $265.69 277 1.7 38 SKU-003203
3204 Economy Sports & Outdoors Product Special Edition Sports & Outdoors $452.31 290 4.9 86 SKU-003204
3205 Standard Electronics Product 2024 Electronics $686.87 404 2.6 265 SKU-003205
3206 Professional Office Supplies Product Lite Office Supplies $55.01 479 2.4 702 SKU-003206
3207 Deluxe Clothing Product Max Clothing $83.48 13 1.7 757 SKU-003207
3208 Deluxe Clothing Product Mini Clothing $52.70 236 4.8 951 SKU-003208
3209 Pro Automotive Product Mini Automotive $663.35 481 4.7 98 SKU-003209
3210 Pro Office Supplies Product 2024 Office Supplies $439.82 296 3.1 870 SKU-003210
3211 Pro Toys & Games Product 2024 Toys & Games $204.90 107 3.5 495 SKU-003211
3212 Premium Books Product Plus Books $489.08 306 3.6 70 SKU-003212
3213 Standard Health & Beauty Product Pro Health & Beauty $832.22 173 3.5 901 SKU-003213
3214 Mega Sports & Outdoors Product Mini Sports & Outdoors $752.59 249 2.6 642 SKU-003214
3215 Professional Electronics Product Special Edition Electronics $984.84 99 2.7 748 SKU-003215
3217 Standard Clothing Product XL Clothing $534.28 384 1.8 915 SKU-003217
3218 Economy Sports & Outdoors Product Lite Sports & Outdoors $486.87 113 5.0 486 SKU-003218
3220 Pro Toys & Games Product Plus Toys & Games $578.93 171 3.2 703 SKU-003220
3221 Pro Automotive Product Lite Automotive $506.48 455 2.9 75 SKU-003221
3222 Deluxe Food & Grocery Product Lite Food & Grocery $785.32 485 2.6 115 SKU-003222
3223 Standard Health & Beauty Product Classic Health & Beauty $839.43 24 4.8 64 SKU-003223
3224 Standard Toys & Games Product Plus Toys & Games $605.89 73 3.7 551 SKU-003224
3225 Super Sports & Outdoors Product Lite Sports & Outdoors $195.69 393 4.8 497 SKU-003225
3226 Deluxe Books Product Classic Books $814.60 289 4.8 198 SKU-003226
3227 Premium Health & Beauty Product XL Health & Beauty $770.60 386 3.2 60 SKU-003227
3228 Super Health & Beauty Product Advanced Health & Beauty $258.59 100 3.8 708 SKU-003228
3229 Economy Home & Garden Product 2024 Home & Garden $952.17 477 4.0 890 SKU-003229
3230 Pro Health & Beauty Product Advanced Health & Beauty $43.57 19 1.6 415 SKU-003230
3231 Mega Electronics Product XL Electronics $458.30 228 2.6 598 SKU-003231
3232 Deluxe Home & Garden Product Plus Home & Garden $126.34 498 3.6 956 SKU-003232
3234 Ultra Automotive Product Mini Automotive $223.61 345 1.6 626 SKU-003234
3235 Premium Sports & Outdoors Product Special Edition Sports & Outdoors $221.94 256 2.6 859 SKU-003235
3237 Elite Office Supplies Product 2024 Office Supplies $993.73 462 3.8 323 SKU-003237
3238 Mega Electronics Product Classic Electronics $493.55 324 3.2 609 SKU-003238
3239 Super Food & Grocery Product Plus Food & Grocery $755.37 245 2.2 994 SKU-003239
3240 Standard Clothing Product XL Clothing $373.29 9 2.3 478 SKU-003240
3241 Premium Automotive Product Special Edition Automotive $570.31 149 1.9 190 SKU-003241
3242 Standard Office Supplies Product 2024 Office Supplies $451.58 447 2.2 421 SKU-003242
3243 Standard Automotive Product Classic Automotive $954.37 347 4.3 146 SKU-003243
3244 Standard Clothing Product Special Edition Clothing $652.25 7 3.9 310 SKU-003244
3245 Ultra Automotive Product Mini Automotive $995.01 401 4.0 517 SKU-003245
3246 Premium Electronics Product Max Electronics $358.43 232 2.0 882 SKU-003246
3249 Economy Sports & Outdoors Product Plus Sports & Outdoors $140.62 242 1.3 334 SKU-003249
3250 Pro Automotive Product Classic Automotive $226.30 183 1.7 940 SKU-003250
3251 Standard Food & Grocery Product Classic Food & Grocery $632.40 472 1.7 293 SKU-003251
3252 Economy Health & Beauty Product Lite Health & Beauty $757.26 253 1.5 85 SKU-003252
3253 Super Sports & Outdoors Product Mini Sports & Outdoors $534.55 208 2.4 174 SKU-003253
3254 Premium Sports & Outdoors Product Plus Sports & Outdoors $708.20 155 1.6 268 SKU-003254
3255 Pro Automotive Product Pro Automotive $689.89 481 3.4 236 SKU-003255
3256 Pro Electronics Product Mini Electronics $495.64 202 2.2 455 SKU-003256
3259 Super Electronics Product Plus Electronics $354.82 199 2.6 362 SKU-003259
3260 Premium Toys & Games Product Advanced Toys & Games $201.10 120 1.2 411 SKU-003260
3261 Standard Home & Garden Product Lite Home & Garden $448.70 355 1.7 384 SKU-003261
3262 Super Food & Grocery Product 2024 Food & Grocery $145.59 217 2.8 313 SKU-003262
3263 Economy Clothing Product Classic Clothing $649.92 267 2.8 754 SKU-003263
3264 Premium Food & Grocery Product Max Food & Grocery $557.48 195 3.0 528 SKU-003264
3267 Elite Books Product 2024 Books $378.82 361 1.7 845 SKU-003267
3268 Elite Electronics Product Advanced Electronics $124.68 61 4.3 954 SKU-003268
3269 Super Office Supplies Product Classic Office Supplies $541.41 134 1.2 179 SKU-003269
3270 Mega Home & Garden Product XL Home & Garden $18.00 306 4.1 760 SKU-003270
3271 Premium Clothing Product Mini Clothing $77.03 436 4.9 729 SKU-003271
3273 Professional Food & Grocery Product XL Food & Grocery $495.39 380 2.6 653 SKU-003273
3274 Professional Books Product Advanced Books $380.46 340 4.5 237 SKU-003274
3276 Elite Toys & Games Product XL Toys & Games $748.74 194 3.0 444 SKU-003276
3278 Professional Sports & Outdoors Product Max Sports & Outdoors $535.02 378 1.1 48 SKU-003278
3279 Professional Automotive Product 2024 Automotive $602.56 482 2.6 792 SKU-003279
3280 Standard Electronics Product Special Edition Electronics $387.11 204 3.8 248 SKU-003280
3281 Elite Sports & Outdoors Product XL Sports & Outdoors $294.55 209 3.5 201 SKU-003281
3282 Deluxe Electronics Product Special Edition Electronics $55.78 388 2.1 455 SKU-003282
3283 Super Automotive Product 2024 Automotive $422.28 108 2.6 998 SKU-003283
3286 Elite Toys & Games Product Mini Toys & Games $878.34 256 4.6 803 SKU-003286
3288 Super Books Product XL Books $145.82 378 2.6 112 SKU-003288
3289 Deluxe Clothing Product Classic Clothing $241.36 317 3.7 279 SKU-003289
3290 Super Electronics Product Pro Electronics $532.98 482 3.3 146 SKU-003290
3292 Pro Clothing Product Mini Clothing $341.52 3 1.6 269 SKU-003292
3293 Standard Books Product Special Edition Books $479.18 481 1.1 722 SKU-003293
3294 Ultra Health & Beauty Product Advanced Health & Beauty $33.92 419 3.4 626 SKU-003294
3295 Super Books Product Mini Books $593.78 148 1.7 595 SKU-003295
3296 Deluxe Food & Grocery Product Special Edition Food & Grocery $617.12 221 3.9 337 SKU-003296
3298 Elite Toys & Games Product Plus Toys & Games $152.75 331 3.9 288 SKU-003298
3299 Deluxe Food & Grocery Product Classic Food & Grocery $991.61 188 3.9 516 SKU-003299
3301 Economy Books Product Classic Books $289.75 203 5.0 417 SKU-003301
3302 Deluxe Books Product Special Edition Books $461.26 60 2.5 360 SKU-003302
3303 Professional Home & Garden Product Special Edition Home & Garden $576.77 17 4.0 427 SKU-003303
3304 Premium Books Product 2024 Books $470.55 196 2.0 540 SKU-003304
3305 Elite Toys & Games Product Mini Toys & Games $56.70 42 2.9 110 SKU-003305
3306 Ultra Automotive Product Advanced Automotive $650.91 80 3.5 355 SKU-003306
3307 Standard Sports & Outdoors Product XL Sports & Outdoors $690.59 294 1.8 144 SKU-003307
3308 Professional Office Supplies Product Max Office Supplies $563.75 193 3.5 962 SKU-003308
3309 Mega Toys & Games Product Lite Toys & Games $210.07 160 3.2 922 SKU-003309
3310 Deluxe Toys & Games Product Classic Toys & Games $606.41 473 2.3 915 SKU-003310
3311 Professional Toys & Games Product Lite Toys & Games $368.86 178 3.4 296 SKU-003311
3312 Premium Office Supplies Product Pro Office Supplies $197.91 334 2.8 846 SKU-003312
3313 Mega Electronics Product Lite Electronics $331.73 285 3.8 561 SKU-003313
3314 Deluxe Food & Grocery Product Plus Food & Grocery $868.60 98 2.2 764 SKU-003314
3315 Standard Automotive Product XL Automotive $360.23 157 3.1 959 SKU-003315
3316 Deluxe Electronics Product Pro Electronics $405.64 219 2.5 358 SKU-003316
3317 Super Toys & Games Product Classic Toys & Games $745.16 413 2.6 186 SKU-003317
3319 Mega Food & Grocery Product Pro Food & Grocery $392.05 481 3.8 62 SKU-003319
3320 Economy Food & Grocery Product Lite Food & Grocery $311.75 49 1.2 132 SKU-003320
3321 Super Automotive Product 2024 Automotive $273.46 254 4.3 701 SKU-003321
3322 Mega Food & Grocery Product XL Food & Grocery $582.83 259 1.5 233 SKU-003322
3323 Deluxe Food & Grocery Product XL Food & Grocery $303.80 116 2.9 817 SKU-003323
3324 Premium Sports & Outdoors Product Advanced Sports & Outdoors $671.18 162 2.1 633 SKU-003324
3325 Pro Electronics Product Special Edition Electronics $337.35 369 1.0 837 SKU-003325
3327 Pro Electronics Product 2024 Electronics $586.67 408 3.4 222 SKU-003327
3328 Deluxe Clothing Product 2024 Clothing $856.07 302 1.4 323 SKU-003328
3329 Professional Office Supplies Product Classic Office Supplies $553.96 205 2.4 115 SKU-003329
3330 Deluxe Books Product Special Edition Books $398.52 270 1.9 655 SKU-003330
3331 Standard Office Supplies Product Mini Office Supplies $917.36 364 3.6 130 SKU-003331
3332 Pro Food & Grocery Product Pro Food & Grocery $240.76 411 4.0 730 SKU-003332
3334 Elite Toys & Games Product Plus Toys & Games $532.47 358 3.6 723 SKU-003334
3335 Premium Office Supplies Product Mini Office Supplies $698.69 445 2.8 760 SKU-003335
3336 Mega Toys & Games Product Pro Toys & Games $169.48 454 3.2 794 SKU-003336
3337 Ultra Automotive Product 2024 Automotive $482.64 476 3.7 284 SKU-003337
3338 Professional Office Supplies Product Special Edition Office Supplies $841.31 3 3.2 850 SKU-003338
3339 Ultra Office Supplies Product 2024 Office Supplies $607.74 423 1.7 416 SKU-003339
3340 Mega Home & Garden Product Mini Home & Garden $451.60 462 1.8 160 SKU-003340
3341 Pro Office Supplies Product 2024 Office Supplies $805.62 296 3.6 983 SKU-003341
3342 Ultra Home & Garden Product Max Home & Garden $209.08 98 4.2 798 SKU-003342
3343 Mega Home & Garden Product Advanced Home & Garden $822.85 480 2.8 400 SKU-003343
3344 Economy Health & Beauty Product 2024 Health & Beauty $838.50 97 1.1 755 SKU-003344
3345 Deluxe Automotive Product Advanced Automotive $216.35 489 1.5 760 SKU-003345
3346 Economy Office Supplies Product 2024 Office Supplies $967.29 447 2.3 578 SKU-003346
3347 Deluxe Health & Beauty Product Advanced Health & Beauty $117.89 174 4.9 660 SKU-003347
3348 Pro Office Supplies Product Advanced Office Supplies $108.94 359 3.3 194 SKU-003348
3349 Mega Automotive Product Max Automotive $190.03 35 2.0 694 SKU-003349
3350 Professional Books Product Max Books $143.08 312 2.3 371 SKU-003350
3351 Pro Home & Garden Product Special Edition Home & Garden $782.92 191 3.3 214 SKU-003351
3352 Mega Office Supplies Product Advanced Office Supplies $296.48 38 3.3 520 SKU-003352
3353 Ultra Food & Grocery Product Lite Food & Grocery $793.21 14 2.2 601 SKU-003353
3354 Elite Books Product Max Books $746.70 29 4.4 680 SKU-003354
3355 Premium Books Product 2024 Books $681.00 447 4.4 350 SKU-003355
3356 Ultra Office Supplies Product Max Office Supplies $919.03 329 4.3 524 SKU-003356
3357 Ultra Books Product Plus Books $529.08 418 1.4 228 SKU-003357
3358 Mega Automotive Product Lite Automotive $849.29 109 1.3 321 SKU-003358
3360 Mega Automotive Product Plus Automotive $309.44 310 5.0 802 SKU-003360
3361 Professional Home & Garden Product Advanced Home & Garden $795.36 142 1.1 110 SKU-003361
3362 Pro Electronics Product Classic Electronics $567.72 113 3.7 531 SKU-003362
3363 Mega Food & Grocery Product Mini Food & Grocery $478.48 208 3.4 715 SKU-003363
3364 Deluxe Food & Grocery Product Lite Food & Grocery $486.87 237 1.4 234 SKU-003364
3365 Pro Automotive Product Lite Automotive $838.41 369 2.5 909 SKU-003365
3366 Pro Automotive Product 2024 Automotive $37.83 103 2.1 183 SKU-003366
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