Pagination should probably be redone the way Reddit does it. That is, give a “next page” token which is from an indexed field at the end of every page, instead of page=NUMBER. Then getting the next page becomes WHERE token>xyz which is an indexed operation, instead of OFFSET NUMBER, which requires counting off that many rows and gives the person duplicate results if new posts are arriving while the person browses. This is a well known performance trick. Wikipedia does it too, and I think ‘SQL Performance Explained’ by Marcus Winand talks about it.
Pagination should probably be redone the way Reddit does it. That is, give a “next page” token which is from an indexed field at the end of every page, instead of page=NUMBER. Then getting the next page becomes WHERE token>xyz which is an indexed operation, instead of OFFSET NUMBER, which requires counting off that many rows and gives the person duplicate results if new posts are arriving while the person browses. This is a well known performance trick. Wikipedia does it too, and I think ‘SQL Performance Explained’ by Marcus Winand talks about it.
There’s already a pull request on changing paging.
My focus is a very hard wall on performance, scale. There is way too much potential for data to run into the full post table as things are now.