You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A user generated over 100,000 DB request because of that.
My solution which is instantaneous:
defget_template_filescurrent_user=User.find(self.user_id)tag_ids=current_user.available_tags.where(["name like ?","%template%"]).pluck(:id)Userfile.find_all_accessible_by_user(current_user).joins(:tags).where('tags.id'=>tag_ids).raw_rows('userfiles.name','userfiles.id')end
Careful, the IDs returned are no longer strings. Adjust if needed.
The text was updated successfully, but these errors were encountered:
Seen in fsl_melodic/portal/portal.rb
It takes minutes to generate a simple list of template files tagged by "template" using this code:
A user generated over 100,000 DB request because of that.
My solution which is instantaneous:
Careful, the IDs returned are no longer strings. Adjust if needed.
The text was updated successfully, but these errors were encountered: