OFFSET skips rows before showing a page.

highlighted = computed this step

Move the page window

OFFSET skips rows from the front of the already ordered result.

skip first, then show page\text{skip first, then show page}

Skip before the page

Offset skips 2 rows, then the page shows 2 rows.

offset=2\text{offset}=2

Ordering examples are tiny finite table transforms; SQL dialects, NULL ordering, collations, indexes, optimizer behavior, performance, and product behavior are out of scope.

Move the page window: base tablesourceRowidkindscore01book9012game7523book7534game9045book90 order bycolumndirectionscoredescidasc sort keyssourceRowkey0[90, 1]1[75, 2]2[75, 3]3[90, 4]4[90, 5] ordered rowssourceRowidkindscore01book9034game9045book9012game7523book75 page rowssourceRowidkindscore45book9012game75 tie groupskeysourceRowsnonenone order factsfactvaluerowCount5orderColumnCount2orderedRowCount5offset2limit2pageRowCount2skippedBeforeCount2skippedAfterCount1unstableTiesnodeterministicTieOrdernot_needed

Read the window

The page rows are the middle slice of the ordered rows.

page window\text{page window}

Summary

Pagination is exact here because the sorted input is tiny and pinned.

finite window\text{finite window}