Pagination in MySQL
There are two primary ways to paginate in MySQL: offset/limit and cursors. If you sort your rows by a column that is not unique, MySQL gets to decide which order to return these rows in. The easiest way to produce deterministic ordering is to order by a unique column because every value will be distinct.