Have you already tried using
Primary Keys [
^]and
Indexes[
^].
For e.g. you could create a composite key on Likes table using a combination of Product and User Id. Not only it will makes sure that you don't have duplicate values, but will also enable to apply the indexes on this table.
I hope that helps!