does it make sense to create indexes for a table called user_movies with the following columns:
user_id
movie_id
There will be much more reading than inserting or updating on this table but I’m not sure what to do. Also: Is it adequate to omit a primary key in this situation?
The correct definition for this table is as follows:
Notice “primary key” is a constraint, not a column. It’s best practice to have a primary key constraint in every table. Do not confuse primary key constraint with an auto-generated pseudokey column.
In MySQL, declaring a foreign key or a primary key implicitly creates an index. Yes, these are beneficial.