unt-libraries / django-nomination

A Django application for nominating URLs by project.
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Feed fix #82

Closed somexpert closed 7 years ago

somexpert commented 7 years ago

Currently the feeds for URLs and nominations can be extremely slow when there are many nominated URLs. This is because of the huge amount of queries being done by the feeds in those cases. This is a fix that significantly reduces the total # of database queries needed.

somexpert commented 7 years ago

@ldko, this is ready for review.

ldko commented 7 years ago

When I mentioned adding a comment to get_object, I meant nomination_feed.get_object. The "Check the saved dict..." comments are pretty redundant to the code. I was more looking for a comment (or a docstring) to say why were are calling no_dup_dict--something along the lines of "Generate attribute/value dicts excluding entities with multiple values for the same attribute to prevent incorrectly associating values from other nominations of the same entity." I have a feeling we will look at this code down the line and wonder why the heck we did this.

somexpert commented 7 years ago

gotcha. on it.

ldko commented 7 years ago

I think this will gave us the same functionality with many less db hits. :+1: