Efficient Pagination with Skip/Take

Efficient pagination using OFFSET-FETCH on SQL Server.

Execution Time

28 ms

Page Size

200

Current Page

2 / 123

Total Records

24441

Items per page: 25 50 100 200

Page 2 Results Showing 201 - 400 of 24441

ID Name Category Price Stock Rating Reviews SKU
222 Premium Clothing Product Advanced Clothing $201.72 269 3.3 247 SKU-000222
223 Elite Books Product Advanced Books $213.18 479 2.0 974 SKU-000223
224 Standard Books Product Advanced Books $298.29 107 3.1 863 SKU-000224
225 Ultra Automotive Product Advanced Automotive $18.81 103 4.8 115 SKU-000225
226 Elite Automotive Product Max Automotive $240.21 107 1.2 699 SKU-000226
227 Economy Electronics Product Lite Electronics $830.47 159 3.4 621 SKU-000227
228 Economy Clothing Product Plus Clothing $64.43 73 1.8 269 SKU-000228
229 Professional Health & Beauty Product Lite Health & Beauty $136.72 450 4.6 793 SKU-000229
230 Mega Clothing Product XL Clothing $875.43 208 3.2 986 SKU-000230
231 Mega Toys & Games Product 2024 Toys & Games $835.08 68 4.6 252 SKU-000231
232 Pro Clothing Product Max Clothing $547.14 144 2.5 3 SKU-000232
233 Mega Office Supplies Product XL Office Supplies $641.24 402 3.7 550 SKU-000233
234 Pro Books Product Max Books $284.07 169 3.6 135 SKU-000234
235 Ultra Food & Grocery Product Special Edition Food & Grocery $35.36 399 3.3 117 SKU-000235
236 Elite Home & Garden Product Advanced Home & Garden $416.19 445 3.0 737 SKU-000236
237 Premium Sports & Outdoors Product Max Sports & Outdoors $629.83 343 1.7 256 SKU-000237
238 Standard Toys & Games Product 2024 Toys & Games $570.46 196 4.6 860 SKU-000238
240 Standard Clothing Product 2024 Clothing $519.23 6 4.8 132 SKU-000240
242 Deluxe Automotive Product Max Automotive $719.14 253 3.2 846 SKU-000242
243 Elite Sports & Outdoors Product 2024 Sports & Outdoors $370.82 20 3.9 33 SKU-000243
245 Deluxe Books Product Advanced Books $123.39 36 2.1 990 SKU-000245
246 Super Electronics Product 2024 Electronics $368.00 483 2.0 168 SKU-000246
247 Mega Food & Grocery Product Advanced Food & Grocery $533.87 230 2.5 923 SKU-000247
248 Ultra Office Supplies Product Plus Office Supplies $447.82 373 1.5 280 SKU-000248
249 Elite Home & Garden Product Special Edition Home & Garden $860.38 264 1.7 167 SKU-000249
250 Economy Food & Grocery Product Classic Food & Grocery $606.63 52 3.3 328 SKU-000250
251 Elite Clothing Product Lite Clothing $632.61 55 1.7 473 SKU-000251
252 Mega Food & Grocery Product XL Food & Grocery $499.64 127 3.5 947 SKU-000252
253 Pro Automotive Product Lite Automotive $218.08 4 2.6 685 SKU-000253
254 Professional Home & Garden Product Pro Home & Garden $674.83 69 3.3 97 SKU-000254
255 Standard Electronics Product Lite Electronics $450.81 206 1.9 765 SKU-000255
256 Elite Toys & Games Product 2024 Toys & Games $411.15 408 4.7 673 SKU-000256
257 Economy Toys & Games Product Advanced Toys & Games $451.59 141 2.0 515 SKU-000257
258 Professional Food & Grocery Product Pro Food & Grocery $69.33 290 2.8 745 SKU-000258
259 Super Electronics Product Mini Electronics $371.47 231 5.0 221 SKU-000259
260 Ultra Office Supplies Product Advanced Office Supplies $557.28 150 2.5 50 SKU-000260
261 Professional Books Product Special Edition Books $354.94 314 2.1 54 SKU-000261
262 Elite Food & Grocery Product Pro Food & Grocery $451.76 409 3.0 757 SKU-000262
263 Elite Books Product Pro Books $443.88 1 4.6 904 SKU-000263
264 Mega Health & Beauty Product Classic Health & Beauty $134.76 386 1.4 406 SKU-000264
265 Mega Electronics Product Classic Electronics $193.78 458 3.5 923 SKU-000265
266 Deluxe Food & Grocery Product 2024 Food & Grocery $223.10 0 1.3 848 SKU-000266
267 Economy Clothing Product 2024 Clothing $359.16 266 4.1 221 SKU-000267
268 Super Books Product Pro Books $779.05 259 3.2 261 SKU-000268
271 Elite Toys & Games Product Max Toys & Games $377.34 470 2.1 602 SKU-000271
272 Ultra Electronics Product Max Electronics $894.91 368 4.6 380 SKU-000272
273 Pro Office Supplies Product Plus Office Supplies $857.30 425 2.7 83 SKU-000273
274 Economy Toys & Games Product Plus Toys & Games $900.40 259 2.3 454 SKU-000274
275 Elite Office Supplies Product Lite Office Supplies $421.59 45 2.3 821 SKU-000275
276 Ultra Food & Grocery Product Special Edition Food & Grocery $14.61 101 2.3 379 SKU-000276
277 Ultra Clothing Product Lite Clothing $885.80 223 3.8 775 SKU-000277
278 Mega Toys & Games Product Plus Toys & Games $894.71 90 2.3 435 SKU-000278
279 Deluxe Office Supplies Product Advanced Office Supplies $654.20 339 2.2 546 SKU-000279
281 Pro Books Product Lite Books $761.35 316 2.2 767 SKU-000281
282 Mega Health & Beauty Product Special Edition Health & Beauty $944.98 465 3.5 884 SKU-000282
283 Premium Toys & Games Product Mini Toys & Games $20.29 258 3.6 414 SKU-000283
284 Premium Books Product XL Books $18.53 129 2.6 216 SKU-000284
285 Mega Clothing Product Classic Clothing $700.90 426 3.1 789 SKU-000285
286 Ultra Office Supplies Product Special Edition Office Supplies $12.03 210 4.2 795 SKU-000286
287 Ultra Books Product 2024 Books $852.90 471 3.6 386 SKU-000287
288 Premium Food & Grocery Product XL Food & Grocery $927.15 349 3.7 271 SKU-000288
289 Super Home & Garden Product Pro Home & Garden $96.43 462 4.5 420 SKU-000289
290 Economy Clothing Product Classic Clothing $695.34 201 3.5 218 SKU-000290
291 Standard Sports & Outdoors Product Special Edition Sports & Outdoors $806.66 136 2.8 746 SKU-000291
293 Premium Food & Grocery Product 2024 Food & Grocery $162.70 150 1.5 976 SKU-000293
294 Economy Health & Beauty Product Lite Health & Beauty $624.56 353 3.7 754 SKU-000294
295 Mega Sports & Outdoors Product Advanced Sports & Outdoors $141.82 364 3.7 998 SKU-000295
296 Standard Automotive Product Plus Automotive $748.85 180 2.0 337 SKU-000296
297 Pro Home & Garden Product Classic Home & Garden $29.98 499 1.5 703 SKU-000297
299 Standard Food & Grocery Product Max Food & Grocery $494.95 143 4.1 490 SKU-000299
300 Economy Home & Garden Product Mini Home & Garden $37.33 432 2.9 575 SKU-000300
301 Deluxe Home & Garden Product Pro Home & Garden $872.37 274 4.0 161 SKU-000301
302 Standard Automotive Product Plus Automotive $437.46 222 2.6 365 SKU-000302
303 Premium Health & Beauty Product Classic Health & Beauty $835.39 146 3.2 495 SKU-000303
304 Standard Food & Grocery Product Advanced Food & Grocery $216.71 164 1.3 774 SKU-000304
305 Super Books Product Max Books $396.40 455 4.4 495 SKU-000305
306 Standard Clothing Product Classic Clothing $310.39 297 3.7 427 SKU-000306
307 Economy Books Product Pro Books $650.32 377 3.1 653 SKU-000307
308 Standard Clothing Product Special Edition Clothing $356.63 480 2.8 66 SKU-000308
309 Standard Health & Beauty Product Pro Health & Beauty $197.23 135 3.6 902 SKU-000309
310 Ultra Office Supplies Product Special Edition Office Supplies $992.30 277 3.2 896 SKU-000310
311 Professional Home & Garden Product XL Home & Garden $824.56 61 3.1 198 SKU-000311
312 Standard Health & Beauty Product Special Edition Health & Beauty $576.19 407 3.7 323 SKU-000312
313 Super Automotive Product Classic Automotive $59.16 326 1.5 142 SKU-000313
314 Ultra Office Supplies Product Advanced Office Supplies $118.54 214 4.7 377 SKU-000314
316 Premium Sports & Outdoors Product Lite Sports & Outdoors $428.42 15 3.5 627 SKU-000316
317 Pro Home & Garden Product Mini Home & Garden $921.48 387 4.4 193 SKU-000317
318 Mega Electronics Product Pro Electronics $686.03 173 3.0 774 SKU-000318
319 Standard Toys & Games Product 2024 Toys & Games $979.35 92 1.8 865 SKU-000319
321 Professional Clothing Product Classic Clothing $51.91 449 3.6 533 SKU-000321
322 Deluxe Books Product Plus Books $162.17 278 3.2 231 SKU-000322
323 Professional Food & Grocery Product Special Edition Food & Grocery $867.27 283 1.5 94 SKU-000323
324 Economy Books Product Special Edition Books $804.96 438 2.2 302 SKU-000324
325 Pro Toys & Games Product Mini Toys & Games $960.75 127 2.1 705 SKU-000325
326 Professional Home & Garden Product Mini Home & Garden $12.50 64 1.8 889 SKU-000326
327 Ultra Sports & Outdoors Product 2024 Sports & Outdoors $785.18 244 3.1 911 SKU-000327
328 Economy Toys & Games Product Plus Toys & Games $400.39 132 3.9 482 SKU-000328
329 Professional Home & Garden Product Mini Home & Garden $952.44 144 1.2 663 SKU-000329
331 Pro Home & Garden Product Max Home & Garden $840.52 467 1.3 769 SKU-000331
332 Super Health & Beauty Product Advanced Health & Beauty $773.88 188 3.1 558 SKU-000332
333 Pro Clothing Product Pro Clothing $172.82 211 1.5 815 SKU-000333
334 Elite Health & Beauty Product 2024 Health & Beauty $159.69 92 3.7 535 SKU-000334
335 Premium Health & Beauty Product Classic Health & Beauty $234.68 382 3.2 833 SKU-000335
336 Premium Automotive Product Mini Automotive $474.58 34 2.1 462 SKU-000336
337 Standard Automotive Product Classic Automotive $467.93 154 3.6 458 SKU-000337
338 Mega Clothing Product Pro Clothing $616.94 77 3.4 542 SKU-000338
339 Mega Sports & Outdoors Product Classic Sports & Outdoors $357.13 189 2.0 966 SKU-000339
340 Premium Books Product Plus Books $476.70 12 2.6 679 SKU-000340
341 Deluxe Books Product Pro Books $139.90 417 3.5 241 SKU-000341
342 Pro Books Product Advanced Books $834.31 322 1.0 691 SKU-000342
343 Pro Health & Beauty Product Lite Health & Beauty $187.54 370 3.2 141 SKU-000343
344 Mega Food & Grocery Product Classic Food & Grocery $530.05 1 2.7 854 SKU-000344
345 Super Toys & Games Product Max Toys & Games $21.24 359 3.3 940 SKU-000345
346 Standard Electronics Product 2024 Electronics $439.97 394 3.6 153 SKU-000346
347 Deluxe Sports & Outdoors Product Pro Sports & Outdoors $977.31 99 4.3 85 SKU-000347
348 Standard Toys & Games Product Lite Toys & Games $413.43 68 3.6 228 SKU-000348
350 Standard Home & Garden Product Max Home & Garden $820.08 320 3.0 914 SKU-000350
351 Deluxe Clothing Product Special Edition Clothing $150.40 140 2.7 984 SKU-000351
352 Deluxe Food & Grocery Product Special Edition Food & Grocery $574.04 29 3.1 412 SKU-000352
353 Mega Electronics Product Mini Electronics $947.10 176 1.1 552 SKU-000353
354 Pro Clothing Product Pro Clothing $520.50 410 4.4 305 SKU-000354
355 Premium Food & Grocery Product Pro Food & Grocery $208.51 369 2.0 655 SKU-000355
356 Economy Office Supplies Product Advanced Office Supplies $620.94 354 1.3 815 SKU-000356
357 Pro Home & Garden Product Special Edition Home & Garden $467.20 90 1.1 140 SKU-000357
358 Mega Electronics Product Special Edition Electronics $414.35 499 2.5 42 SKU-000358
360 Premium Electronics Product Classic Electronics $607.55 297 1.7 303 SKU-000360
361 Economy Health & Beauty Product Pro Health & Beauty $71.70 163 1.1 729 SKU-000361
363 Standard Electronics Product 2024 Electronics $770.25 131 3.6 445 SKU-000363
364 Deluxe Health & Beauty Product Max Health & Beauty $303.19 223 1.7 427 SKU-000364
365 Ultra Automotive Product Max Automotive $50.03 496 3.9 684 SKU-000365
366 Ultra Food & Grocery Product Max Food & Grocery $608.08 416 3.4 275 SKU-000366
367 Premium Office Supplies Product Max Office Supplies $699.08 465 4.1 93 SKU-000367
368 Premium Sports & Outdoors Product Special Edition Sports & Outdoors $893.61 163 3.5 672 SKU-000368
369 Super Toys & Games Product Lite Toys & Games $460.82 479 4.4 843 SKU-000369
370 Ultra Food & Grocery Product Special Edition Food & Grocery $494.84 355 1.6 881 SKU-000370
371 Economy Electronics Product XL Electronics $959.81 483 1.5 59 SKU-000371
372 Super Sports & Outdoors Product Max Sports & Outdoors $50.13 22 3.3 734 SKU-000372
373 Mega Clothing Product XL Clothing $814.15 127 4.8 19 SKU-000373
374 Deluxe Office Supplies Product XL Office Supplies $422.03 371 3.8 907 SKU-000374
375 Premium Health & Beauty Product Lite Health & Beauty $581.33 371 2.3 362 SKU-000375
376 Super Sports & Outdoors Product Max Sports & Outdoors $576.15 435 1.9 370 SKU-000376
377 Pro Sports & Outdoors Product Classic Sports & Outdoors $490.30 277 3.1 393 SKU-000377
378 Elite Health & Beauty Product Max Health & Beauty $247.17 476 3.9 46 SKU-000378
379 Ultra Health & Beauty Product Plus Health & Beauty $591.51 145 2.6 812 SKU-000379
381 Super Clothing Product Lite Clothing $500.65 427 1.4 713 SKU-000381
382 Standard Food & Grocery Product Lite Food & Grocery $860.17 274 1.9 338 SKU-000382
383 Economy Food & Grocery Product Mini Food & Grocery $780.99 228 1.9 703 SKU-000383
384 Professional Home & Garden Product XL Home & Garden $355.27 411 3.8 925 SKU-000384
385 Super Sports & Outdoors Product Advanced Sports & Outdoors $383.02 320 4.5 241 SKU-000385
386 Super Books Product Lite Books $575.59 417 2.6 252 SKU-000386
387 Pro Toys & Games Product 2024 Toys & Games $483.63 115 3.2 861 SKU-000387
388 Standard Books Product Lite Books $48.48 234 2.4 502 SKU-000388
389 Elite Automotive Product 2024 Automotive $197.91 44 2.0 254 SKU-000389
390 Standard Toys & Games Product Lite Toys & Games $42.37 446 3.7 310 SKU-000390
391 Premium Home & Garden Product Lite Home & Garden $339.48 29 2.7 787 SKU-000391
392 Elite Books Product Plus Books $890.43 246 1.2 382 SKU-000392
393 Ultra Books Product Max Books $111.91 486 3.3 996 SKU-000393
394 Pro Books Product Lite Books $325.41 32 2.6 730 SKU-000394
395 Deluxe Office Supplies Product Pro Office Supplies $714.44 153 3.3 47 SKU-000395
399 Premium Toys & Games Product Mini Toys & Games $856.60 440 2.0 570 SKU-000399
400 Deluxe Home & Garden Product Advanced Home & Garden $68.22 366 3.0 416 SKU-000400
401 Premium Food & Grocery Product Pro Food & Grocery $467.15 323 3.9 396 SKU-000401
402 Professional Food & Grocery Product Max Food & Grocery $510.05 143 2.0 211 SKU-000402
403 Deluxe Health & Beauty Product Pro Health & Beauty $691.46 110 1.9 526 SKU-000403
404 Premium Office Supplies Product Advanced Office Supplies $277.60 8 3.9 423 SKU-000404
405 Premium Food & Grocery Product Plus Food & Grocery $886.83 379 4.1 527 SKU-000405
406 Ultra Health & Beauty Product XL Health & Beauty $70.20 52 1.4 345 SKU-000406
407 Standard Office Supplies Product Mini Office Supplies $87.39 220 2.0 669 SKU-000407
408 Professional Clothing Product XL Clothing $286.74 81 1.7 168 SKU-000408
409 Ultra Electronics Product Max Electronics $131.40 205 2.3 110 SKU-000409
410 Economy Books Product Mini Books $736.19 421 4.4 629 SKU-000410
411 Super Books Product Lite Books $70.77 468 4.0 397 SKU-000411
412 Ultra Home & Garden Product Classic Home & Garden $608.49 132 3.6 734 SKU-000412
413 Economy Electronics Product Plus Electronics $368.76 258 2.7 922 SKU-000413
414 Elite Electronics Product XL Electronics $788.26 404 2.6 431 SKU-000414
415 Deluxe Office Supplies Product Classic Office Supplies $380.05 290 2.3 747 SKU-000415
417 Premium Health & Beauty Product 2024 Health & Beauty $962.68 381 3.7 18 SKU-000417
418 Super Office Supplies Product XL Office Supplies $526.83 423 1.5 881 SKU-000418
419 Economy Electronics Product Special Edition Electronics $715.88 361 4.3 972 SKU-000419
421 Economy Home & Garden Product Plus Home & Garden $996.91 340 1.4 978 SKU-000421
422 Standard Toys & Games Product Classic Toys & Games $847.38 102 1.0 691 SKU-000422
424 Standard Automotive Product Pro Automotive $403.93 168 3.2 757 SKU-000424
426 Elite Clothing Product Advanced Clothing $354.63 216 2.7 320 SKU-000426
427 Elite Toys & Games Product XL Toys & Games $101.48 204 1.8 600 SKU-000427
428 Deluxe Home & Garden Product Advanced Home & Garden $791.45 257 4.9 236 SKU-000428
429 Elite Automotive Product Pro Automotive $525.05 446 1.4 37 SKU-000429
430 Pro Electronics Product Lite Electronics $496.63 469 3.6 982 SKU-000430
431 Ultra Sports & Outdoors Product Advanced Sports & Outdoors $183.86 413 2.9 85 SKU-000431
432 Mega Health & Beauty Product Advanced Health & Beauty $554.43 164 3.1 912 SKU-000432
433 Pro Home & Garden Product Mini Home & Garden $950.25 376 4.3 635 SKU-000433
434 Premium Office Supplies Product Classic Office Supplies $848.24 82 3.0 847 SKU-000434
435 Professional Food & Grocery Product Lite Food & Grocery $96.80 219 2.8 279 SKU-000435
436 Mega Food & Grocery Product Special Edition Food & Grocery $657.22 438 1.5 843 SKU-000436
438 Mega Sports & Outdoors Product Max Sports & Outdoors $238.80 182 1.0 324 SKU-000438
440 Premium Health & Beauty Product Advanced Health & Beauty $753.49 139 1.9 412 SKU-000440
443 Standard Electronics Product Special Edition Electronics $575.64 105 2.7 720 SKU-000443
444 Premium Clothing Product Advanced Clothing $645.05 446 4.4 624 SKU-000444
445 Standard Sports & Outdoors Product Special Edition Sports & Outdoors $654.70 284 4.6 251 SKU-000445
446 Standard Home & Garden Product Max Home & Garden $814.15 411 3.8 894 SKU-000446
447 Super Health & Beauty Product Max Health & Beauty $890.18 322 4.1 921 SKU-000447
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