Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make threads lists and profile feeds pagination cursor based #1066

Closed
rafalp opened this issue Aug 20, 2018 · 0 comments
Closed

Make threads lists and profile feeds pagination cursor based #1066

rafalp opened this issue Aug 20, 2018 · 0 comments
Assignees
Labels
area: backend This issue involves Python, Django or dependency (eg. database) enhancement Improvement to existing feature or dev experience
Milestone

Comments

@rafalp
Copy link
Owner

rafalp commented Aug 20, 2018

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.

@rafalp rafalp added decision needed area: backend This issue involves Python, Django or dependency (eg. database) enhancement Improvement to existing feature or dev experience labels Aug 20, 2018
@rafalp rafalp added this to the 0.20.0 milestone Aug 20, 2018
@rafalp rafalp modified the milestones: 0.20.0, 0.19.2 Aug 28, 2018
@rafalp rafalp modified the milestones: 0.19.2, 0.20.0 Sep 9, 2018
@rafalp rafalp removed this from the 0.20.0 milestone Nov 22, 2018
@rafalp rafalp added this to the 0.20.0 milestone Dec 21, 2018
@rafalp rafalp self-assigned this Jan 20, 2019
@rafalp rafalp mentioned this issue Feb 3, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend This issue involves Python, Django or dependency (eg. database) enhancement Improvement to existing feature or dev experience
Projects
None yet
Development

No branches or pull requests

1 participant