1) movie_actors (movie_id, actor_id, order_index) 2) movie_watchlist (movie_id, user_id, created_at) 3) movie_ratings (movie_id, user_id, rating, created_at) I know strange question, but most guides suggest all these table should have autoincrement id column
These index choices are solid. But I suggest for the second one to swap the movie_id and user_id because in most cases you want to get all the watchlist entries for a user and not all users having the movie on the watchlist. Therefore all movies on a users watchlist are close to each other and not spread through the whole table by the movie_id.
Comments (174) 54 threads
Show all comments
Showing thread 19 of 54
1) movie_actors (movie_id, actor_id, order_index)
2) movie_watchlist (movie_id, user_id, created_at)
3) movie_ratings (movie_id, user_id, rating, created_at)
I know strange question, but most guides suggest all these table should have autoincrement id column