Efficient Pagination with Skip/Take

Efficient pagination using OFFSET-FETCH on SQL Server.

Execution Time

9 ms

Page Size

200

Current Page

10 / 123

Total Records

24441

Items per page: 25 50 100 200

Page 10 Results Showing 1801 - 2000 of 24441

ID Name Category Price Stock Rating Reviews SKU
2035 Deluxe Home & Garden Product XL Home & Garden $457.89 201 1.5 253 SKU-002035
2036 Professional Electronics Product Lite Electronics $389.02 152 1.2 254 SKU-002036
2037 Professional Home & Garden Product XL Home & Garden $538.07 294 2.4 292 SKU-002037
2038 Elite Sports & Outdoors Product Special Edition Sports & Outdoors $99.77 9 2.4 347 SKU-002038
2039 Professional Electronics Product XL Electronics $419.57 76 1.6 427 SKU-002039
2040 Pro Books Product Special Edition Books $598.35 275 4.4 579 SKU-002040
2041 Pro Health & Beauty Product Max Health & Beauty $284.45 320 4.8 495 SKU-002041
2042 Economy Sports & Outdoors Product Max Sports & Outdoors $647.07 408 4.0 470 SKU-002042
2043 Ultra Electronics Product Advanced Electronics $896.58 222 2.3 76 SKU-002043
2044 Economy Sports & Outdoors Product XL Sports & Outdoors $919.66 448 1.0 229 SKU-002044
2045 Ultra Automotive Product 2024 Automotive $624.48 250 1.9 477 SKU-002045
2046 Mega Sports & Outdoors Product 2024 Sports & Outdoors $861.96 166 3.0 175 SKU-002046
2047 Pro Toys & Games Product Pro Toys & Games $202.22 118 4.9 92 SKU-002047
2048 Premium Home & Garden Product Classic Home & Garden $457.71 301 3.7 645 SKU-002048
2049 Ultra Clothing Product Plus Clothing $235.80 387 4.1 587 SKU-002049
2050 Pro Books Product XL Books $342.76 492 1.2 770 SKU-002050
2051 Standard Sports & Outdoors Product Advanced Sports & Outdoors $58.95 326 1.6 334 SKU-002051
2053 Pro Toys & Games Product Max Toys & Games $680.25 293 4.2 775 SKU-002053
2054 Mega Clothing Product Max Clothing $157.86 241 1.4 203 SKU-002054
2055 Professional Clothing Product XL Clothing $323.65 314 1.6 315 SKU-002055
2056 Economy Clothing Product Special Edition Clothing $743.65 393 4.1 665 SKU-002056
2057 Mega Office Supplies Product 2024 Office Supplies $725.90 170 3.2 623 SKU-002057
2058 Super Health & Beauty Product Special Edition Health & Beauty $557.24 251 3.7 11 SKU-002058
2059 Super Health & Beauty Product Pro Health & Beauty $825.14 186 4.0 843 SKU-002059
2060 Professional Health & Beauty Product 2024 Health & Beauty $983.22 87 3.0 408 SKU-002060
2061 Elite Books Product Pro Books $575.90 247 4.1 264 SKU-002061
2062 Premium Home & Garden Product Mini Home & Garden $90.32 149 4.2 786 SKU-002062
2063 Mega Health & Beauty Product Mini Health & Beauty $664.61 150 4.4 373 SKU-002063
2064 Super Sports & Outdoors Product Plus Sports & Outdoors $402.35 200 1.0 483 SKU-002064
2065 Elite Office Supplies Product Special Edition Office Supplies $453.91 323 4.9 301 SKU-002065
2066 Super Toys & Games Product Classic Toys & Games $696.71 493 4.6 377 SKU-002066
2067 Economy Office Supplies Product 2024 Office Supplies $508.92 55 3.5 394 SKU-002067
2069 Deluxe Electronics Product Plus Electronics $545.56 206 3.5 636 SKU-002069
2070 Mega Health & Beauty Product Pro Health & Beauty $251.31 420 2.0 566 SKU-002070
2071 Deluxe Office Supplies Product Classic Office Supplies $134.70 243 2.4 391 SKU-002071
2073 Deluxe Sports & Outdoors Product Plus Sports & Outdoors $542.34 81 2.0 563 SKU-002073
2074 Pro Home & Garden Product Advanced Home & Garden $438.45 343 4.9 377 SKU-002074
2075 Elite Office Supplies Product Max Office Supplies $761.64 38 4.5 163 SKU-002075
2076 Premium Sports & Outdoors Product Mini Sports & Outdoors $697.01 199 1.2 402 SKU-002076
2077 Super Books Product XL Books $954.92 129 1.2 712 SKU-002077
2078 Premium Sports & Outdoors Product Classic Sports & Outdoors $190.58 98 3.1 709 SKU-002078
2079 Professional Toys & Games Product Pro Toys & Games $749.31 491 3.0 417 SKU-002079
2080 Elite Food & Grocery Product Special Edition Food & Grocery $294.86 409 1.4 670 SKU-002080
2081 Mega Office Supplies Product Plus Office Supplies $890.77 172 1.7 928 SKU-002081
2082 Economy Electronics Product Plus Electronics $410.13 60 1.5 891 SKU-002082
2084 Elite Health & Beauty Product Lite Health & Beauty $992.91 310 2.3 915 SKU-002084
2085 Super Sports & Outdoors Product Special Edition Sports & Outdoors $507.41 157 3.0 228 SKU-002085
2086 Premium Books Product Advanced Books $130.56 308 2.2 334 SKU-002086
2088 Ultra Books Product Mini Books $424.98 222 1.6 185 SKU-002088
2089 Elite Automotive Product 2024 Automotive $403.93 1 3.6 962 SKU-002089
2090 Super Office Supplies Product Advanced Office Supplies $525.08 180 3.1 901 SKU-002090
2091 Deluxe Books Product Classic Books $67.30 84 2.9 476 SKU-002091
2092 Mega Clothing Product Advanced Clothing $552.05 109 1.8 89 SKU-002092
2094 Economy Electronics Product Pro Electronics $453.80 31 3.7 276 SKU-002094
2095 Premium Clothing Product Special Edition Clothing $515.76 412 2.1 838 SKU-002095
2096 Standard Clothing Product Classic Clothing $425.42 268 1.6 173 SKU-002096
2097 Economy Automotive Product Mini Automotive $215.07 224 2.9 582 SKU-002097
2098 Deluxe Health & Beauty Product Max Health & Beauty $691.99 327 2.7 220 SKU-002098
2100 Super Books Product Lite Books $150.33 345 2.4 229 SKU-002100
2101 Ultra Toys & Games Product Lite Toys & Games $155.66 91 1.1 693 SKU-002101
2102 Deluxe Health & Beauty Product Plus Health & Beauty $735.12 332 1.8 474 SKU-002102
2103 Pro Office Supplies Product Advanced Office Supplies $481.73 463 2.4 585 SKU-002103
2104 Deluxe Clothing Product Pro Clothing $245.71 365 1.6 663 SKU-002104
2105 Pro Books Product Max Books $70.07 144 1.6 282 SKU-002105
2106 Super Office Supplies Product Advanced Office Supplies $428.15 208 1.9 975 SKU-002106
2107 Elite Office Supplies Product Plus Office Supplies $910.23 269 1.3 632 SKU-002107
2108 Economy Health & Beauty Product XL Health & Beauty $350.27 244 4.7 462 SKU-002108
2109 Professional Office Supplies Product Max Office Supplies $155.23 219 3.3 465 SKU-002109
2110 Super Health & Beauty Product Special Edition Health & Beauty $242.83 359 3.6 712 SKU-002110
2111 Deluxe Automotive Product Special Edition Automotive $952.61 294 1.2 615 SKU-002111
2112 Professional Office Supplies Product Max Office Supplies $73.01 433 5.0 955 SKU-002112
2113 Pro Automotive Product Plus Automotive $156.48 497 4.8 272 SKU-002113
2114 Pro Home & Garden Product Pro Home & Garden $949.87 83 4.3 486 SKU-002114
2116 Pro Clothing Product Mini Clothing $789.87 57 3.0 209 SKU-002116
2117 Premium Home & Garden Product Special Edition Home & Garden $324.69 346 2.2 880 SKU-002117
2118 Economy Sports & Outdoors Product Plus Sports & Outdoors $350.03 423 5.0 871 SKU-002118
2119 Elite Sports & Outdoors Product Special Edition Sports & Outdoors $211.93 73 1.9 670 SKU-002119
2120 Economy Toys & Games Product Max Toys & Games $47.68 34 1.6 426 SKU-002120
2121 Deluxe Toys & Games Product Lite Toys & Games $196.78 21 3.5 789 SKU-002121
2122 Premium Home & Garden Product Special Edition Home & Garden $405.14 377 3.8 367 SKU-002122
2123 Deluxe Automotive Product 2024 Automotive $483.83 250 1.6 990 SKU-002123
2124 Economy Sports & Outdoors Product Advanced Sports & Outdoors $767.49 185 4.8 176 SKU-002124
2125 Ultra Toys & Games Product Lite Toys & Games $460.94 402 2.2 359 SKU-002125
2126 Ultra Automotive Product Mini Automotive $213.29 465 4.5 879 SKU-002126
2128 Elite Books Product Pro Books $871.64 279 2.0 344 SKU-002128
2129 Deluxe Electronics Product Lite Electronics $528.12 359 3.3 134 SKU-002129
2130 Super Food & Grocery Product Plus Food & Grocery $163.68 240 2.1 456 SKU-002130
2131 Standard Automotive Product Special Edition Automotive $921.28 27 1.0 963 SKU-002131
2132 Pro Books Product Pro Books $907.04 498 4.9 311 SKU-002132
2133 Economy Clothing Product Lite Clothing $423.25 382 2.7 294 SKU-002133
2134 Ultra Clothing Product 2024 Clothing $982.29 175 1.9 578 SKU-002134
2135 Ultra Clothing Product Max Clothing $714.21 3 4.4 867 SKU-002135
2136 Mega Electronics Product Lite Electronics $391.82 46 2.9 370 SKU-002136
2137 Deluxe Books Product Pro Books $417.71 232 3.0 480 SKU-002137
2138 Standard Sports & Outdoors Product Plus Sports & Outdoors $103.49 279 1.9 337 SKU-002138
2139 Pro Health & Beauty Product Max Health & Beauty $118.41 83 1.1 432 SKU-002139
2140 Premium Home & Garden Product Mini Home & Garden $520.57 251 2.0 124 SKU-002140
2141 Mega Home & Garden Product XL Home & Garden $325.86 107 3.9 156 SKU-002141
2142 Pro Home & Garden Product Classic Home & Garden $691.30 80 3.4 394 SKU-002142
2143 Premium Automotive Product Pro Automotive $777.81 78 1.8 997 SKU-002143
2145 Mega Food & Grocery Product Lite Food & Grocery $290.96 118 2.0 856 SKU-002145
2146 Premium Clothing Product Lite Clothing $745.68 305 3.3 112 SKU-002146
2147 Super Toys & Games Product Advanced Toys & Games $67.58 359 2.5 416 SKU-002147
2148 Pro Food & Grocery Product Plus Food & Grocery $49.51 315 3.0 792 SKU-002148
2149 Super Automotive Product XL Automotive $972.53 499 1.1 126 SKU-002149
2150 Ultra Toys & Games Product Max Toys & Games $131.76 478 4.4 245 SKU-002150
2151 Elite Books Product 2024 Books $44.71 172 3.8 833 SKU-002151
2152 Mega Office Supplies Product Special Edition Office Supplies $222.12 315 3.5 121 SKU-002152
2153 Standard Automotive Product Plus Automotive $840.69 434 3.2 567 SKU-002153
2154 Elite Electronics Product XL Electronics $403.74 310 3.3 586 SKU-002154
2155 Standard Books Product 2024 Books $384.27 126 4.0 482 SKU-002155
2156 Super Home & Garden Product Pro Home & Garden $122.45 336 1.6 411 SKU-002156
2157 Standard Books Product Max Books $799.61 380 4.9 71 SKU-002157
2158 Mega Health & Beauty Product Max Health & Beauty $569.41 79 4.3 971 SKU-002158
2160 Ultra Office Supplies Product Advanced Office Supplies $269.35 443 4.4 923 SKU-002160
2161 Super Electronics Product Pro Electronics $872.21 439 3.3 809 SKU-002161
2162 Mega Food & Grocery Product Pro Food & Grocery $248.23 430 4.5 666 SKU-002162
2163 Pro Sports & Outdoors Product Mini Sports & Outdoors $388.46 95 1.4 99 SKU-002163
2164 Elite Electronics Product Advanced Electronics $313.04 268 3.1 789 SKU-002164
2165 Economy Food & Grocery Product Mini Food & Grocery $616.86 29 4.6 387 SKU-002165
2166 Standard Books Product Classic Books $575.06 384 4.2 759 SKU-002166
2167 Mega Automotive Product Plus Automotive $611.81 376 3.3 493 SKU-002167
2168 Pro Office Supplies Product Max Office Supplies $591.76 193 4.2 439 SKU-002168
2169 Premium Office Supplies Product Pro Office Supplies $993.58 438 2.8 438 SKU-002169
2170 Standard Home & Garden Product Special Edition Home & Garden $793.18 118 3.9 742 SKU-002170
2171 Standard Books Product Lite Books $881.09 91 4.4 100 SKU-002171
2172 Elite Automotive Product Special Edition Automotive $926.59 303 3.5 105 SKU-002172
2173 Standard Health & Beauty Product 2024 Health & Beauty $84.94 198 2.2 928 SKU-002173
2174 Standard Health & Beauty Product Special Edition Health & Beauty $153.10 337 3.8 705 SKU-002174
2175 Economy Clothing Product Classic Clothing $811.81 173 3.5 879 SKU-002175
2177 Standard Toys & Games Product Max Toys & Games $221.40 94 3.2 699 SKU-002177
2178 Professional Sports & Outdoors Product Max Sports & Outdoors $691.22 283 1.6 174 SKU-002178
2179 Standard Automotive Product Max Automotive $457.45 172 2.9 959 SKU-002179
2180 Premium Books Product 2024 Books $57.58 297 3.1 129 SKU-002180
2181 Elite Toys & Games Product Lite Toys & Games $724.39 30 1.1 808 SKU-002181
2182 Elite Electronics Product Lite Electronics $328.42 314 1.5 429 SKU-002182
2183 Mega Electronics Product Lite Electronics $95.87 123 2.1 707 SKU-002183
2184 Professional Health & Beauty Product 2024 Health & Beauty $690.68 107 4.9 989 SKU-002184
2185 Mega Clothing Product Special Edition Clothing $216.84 156 2.6 542 SKU-002185
2186 Premium Automotive Product Advanced Automotive $664.64 205 3.1 665 SKU-002186
2187 Pro Electronics Product Classic Electronics $74.23 115 2.0 968 SKU-002187
2188 Economy Books Product Max Books $605.87 151 4.9 356 SKU-002188
2189 Ultra Automotive Product Advanced Automotive $16.93 202 2.8 292 SKU-002189
2190 Pro Books Product Mini Books $614.91 298 4.3 726 SKU-002190
2191 Deluxe Clothing Product Max Clothing $306.84 227 3.1 425 SKU-002191
2192 Ultra Electronics Product Pro Electronics $333.61 200 2.7 807 SKU-002192
2194 Ultra Automotive Product Plus Automotive $527.25 64 4.3 134 SKU-002194
2195 Professional Sports & Outdoors Product Pro Sports & Outdoors $665.41 85 2.8 972 SKU-002195
2196 Ultra Automotive Product Max Automotive $677.21 211 3.0 768 SKU-002196
2197 Premium Food & Grocery Product Advanced Food & Grocery $413.75 43 3.1 182 SKU-002197
2198 Pro Food & Grocery Product Special Edition Food & Grocery $994.08 61 3.3 260 SKU-002198
2199 Standard Office Supplies Product 2024 Office Supplies $893.09 82 1.7 728 SKU-002199
2200 Deluxe Clothing Product Lite Clothing $96.49 227 4.8 242 SKU-002200
2201 Economy Books Product Plus Books $12.32 385 3.4 226 SKU-002201
2202 Economy Home & Garden Product Classic Home & Garden $516.91 344 3.3 23 SKU-002202
2204 Economy Clothing Product XL Clothing $689.01 215 4.9 575 SKU-002204
2205 Premium Food & Grocery Product 2024 Food & Grocery $588.05 264 2.9 330 SKU-002205
2206 Standard Books Product Advanced Books $129.03 322 1.2 680 SKU-002206
2207 Standard Home & Garden Product Lite Home & Garden $805.36 30 3.8 892 SKU-002207
2208 Ultra Health & Beauty Product Lite Health & Beauty $969.47 263 2.5 792 SKU-002208
2209 Economy Health & Beauty Product Plus Health & Beauty $808.24 376 3.6 933 SKU-002209
2210 Standard Automotive Product Classic Automotive $71.57 58 4.1 457 SKU-002210
2212 Standard Automotive Product Advanced Automotive $476.15 278 2.5 589 SKU-002212
2213 Elite Books Product Max Books $193.21 194 2.9 498 SKU-002213
2214 Professional Books Product Pro Books $17.93 259 4.9 199 SKU-002214
2215 Economy Toys & Games Product Pro Toys & Games $130.86 298 1.5 444 SKU-002215
2216 Deluxe Automotive Product Mini Automotive $999.12 62 4.2 877 SKU-002216
2217 Economy Automotive Product Plus Automotive $310.72 146 1.4 758 SKU-002217
2218 Deluxe Automotive Product Pro Automotive $168.61 382 3.6 171 SKU-002218
2219 Elite Books Product Lite Books $986.07 404 4.5 497 SKU-002219
2220 Standard Toys & Games Product XL Toys & Games $125.55 307 2.2 694 SKU-002220
2221 Mega Clothing Product XL Clothing $631.89 477 2.4 265 SKU-002221
2222 Professional Home & Garden Product XL Home & Garden $509.03 97 3.0 292 SKU-002222
2223 Ultra Food & Grocery Product Classic Food & Grocery $201.94 240 1.1 744 SKU-002223
2224 Deluxe Home & Garden Product Mini Home & Garden $778.33 101 1.3 781 SKU-002224
2225 Super Food & Grocery Product Special Edition Food & Grocery $533.74 153 2.1 432 SKU-002225
2226 Professional Health & Beauty Product Max Health & Beauty $439.81 141 3.0 319 SKU-002226
2227 Standard Automotive Product XL Automotive $704.21 90 4.2 484 SKU-002227
2228 Mega Books Product Pro Books $854.18 61 1.3 401 SKU-002228
2229 Deluxe Books Product XL Books $343.22 229 2.0 447 SKU-002229
2230 Economy Electronics Product Advanced Electronics $58.46 371 4.8 504 SKU-002230
2231 Economy Home & Garden Product Mini Home & Garden $262.96 345 2.1 343 SKU-002231
2232 Premium Books Product Classic Books $671.77 313 5.0 377 SKU-002232
2233 Super Health & Beauty Product Plus Health & Beauty $815.74 9 1.5 327 SKU-002233
2234 Pro Food & Grocery Product Plus Food & Grocery $541.44 324 2.4 4 SKU-002234
2235 Ultra Health & Beauty Product Lite Health & Beauty $475.16 464 2.4 412 SKU-002235
2236 Professional Health & Beauty Product Plus Health & Beauty $469.00 442 2.7 944 SKU-002236
2237 Ultra Sports & Outdoors Product Advanced Sports & Outdoors $555.86 347 3.4 930 SKU-002237
2238 Deluxe Health & Beauty Product Plus Health & Beauty $293.80 249 1.3 15 SKU-002238
2239 Standard Home & Garden Product XL Home & Garden $572.57 189 1.5 638 SKU-002239
2240 Deluxe Electronics Product Advanced Electronics $267.39 178 2.3 431 SKU-002240
2241 Mega Toys & Games Product Plus Toys & Games $98.77 397 1.6 884 SKU-002241
2242 Ultra Clothing Product Advanced Clothing $290.54 459 2.0 307 SKU-002242
2243 Elite Sports & Outdoors Product Mini Sports & Outdoors $619.73 175 2.2 946 SKU-002243
2244 Economy Food & Grocery Product Special Edition Food & Grocery $431.40 27 4.4 919 SKU-002244
2245 Economy Clothing Product Advanced Clothing $108.17 89 3.9 974 SKU-002245
2246 Professional Electronics Product Special Edition Electronics $362.49 181 1.1 244 SKU-002246
2247 Pro Electronics Product XL Electronics $334.52 479 4.1 183 SKU-002247
2248 Economy Electronics Product Advanced Electronics $815.01 55 1.5 634 SKU-002248
2249 Pro Sports & Outdoors Product Mini Sports & Outdoors $883.49 280 2.8 559 SKU-002249
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