I have a website where people can add their favorite series. There is one function that allows you to check the episodes that you saw.
Each episode that is marked creates one entry in the database table (with user_id, show_id and episode_id).
This table now exceeds 600,000 rows and is growing very fast!
I have indexes installed, but I feel that the performance of querying this table is getting worse and worse.
My thoughts on a new solution:
So, instead of:
user_id | show_id | episode_id
1 ....... 123 ......7675
1 ....... 123 ......7676
1 ....... 123 ......7677
1 ....... 456 ......5678
1 ....... 456 ......5679
1 ....... 456 ......5680
I could do this:
user_id | show_id | episode_ids
1 ....... 123 ......7675,7676,7677
1 ....... 456 ......5678,5679,5680
Then I would have to split the string into an array and use array.include? (some-id) .
This should make the database easier, but for Ruby there will be a much heavier array.
? - ?