I have 3 tables:
[users] 1 ----------- n [evaluations] n --------- 1 [items]
Where evaluation can be positive (valuation: true ) or negative (valuation: false ), I need a method that returns all items that the user liked and did not like ... For this I did the following method in the user model:
%pre%The same principle was adopted for the method for the dislike method
The idea is to do this with many users, the problem is that it is taking a long time to return the data. Is there any way to improve the performance of this code snippet? Any structure that I can keep on the server, because this query is executed many times more than once per user ...