Make threads lists and profile feeds pagination cursor based #1066
Labels
area: backend
This issue involves Python, Django or dependency (eg. database)
enhancement
Improvement to existing feature or dev experience
Milestone
Currently Misago relies on Django paginator when slicing querysets on threads lists or user activity feeds. This apprach means that quite costful and complex query of "Read the table and give me X items that met this complexy criteria" is ran greedily (for entire table), and is ran twice (because we are also running the count on it).
Instead, Misago could use cursor approach, where Database would be asked "give me X+1 items meeting those criteria", check if "X+1" item exists to decide if "see more" button should be displayed, and use ID if of last item returned as starting point for next query, eg. "give me 21 threads that meet this criteria, with last_post_id lower than 123" - in theory producing lazily evaluated query and much better query times.
The text was updated successfully, but these errors were encountered: