-
Notifications
You must be signed in to change notification settings - Fork 121
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
.cleanup_read_marks! performance? #64
Comments
ledermann
added a commit
that referenced
this issue
Oct 31, 2015
Run the cleanup for those readers only, who have at least one single read_marks. Belongs to #64
Looks awesome! |
Fine, I will publish the next release soon. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current
.cleanup_read_marks!
appears to iterate over every entry in the table, checking for older entries, and then deleting all but the newest. This could result in a lot of un-used find queries where there are no read marks that need to be cleaned for a certainreadable
. It seems like it could be optimized by having a query with some sort ofWHERE COUNT(read_marks.id) > 1 GROUP BY readable_id, readable_type
, which would only then iterate over things that actually needed cleaning.The text was updated successfully, but these errors were encountered: