Say I have a many to many relationship and when I query the db for the left table using a join from the right table I get duplicates because of this many to many relationship. I can use group by on the primary key to get rid of these in mysql or distinct.
However I've been told that distinct & group by are not good re:performance. With that said, I would also assume mysql performance would be better than javascript performance.
Should I be filtering my results in javascript or use group by in mysql? Any reason why one would be faster than the other?