stopstalk-deployment
stopstalk-deployment copied to clipboard
Whole new DB schema. Maybe a lot efficient, faster and less memory consuming.
trafficstars
Instead of storing the handles and sites in the auth_user table have a table having site handles and site names and then make id of this table as the foreign key for auth_user table.
- Advantages -
- Retrieve(update) submissions of 1 particular handle only once.
- Lot of submissions that are duplicate can be saved
- Disadvantages
- Migration is dangerous
- It will take a bit of time to change the existing code(Surely more than a bit ;) )
Also make a problem table(extend current problem_tags table) and just include problem_id in a submission.
New proposed schema:
| auth_user |
|---|
| first_name |
| last_name |
| password |
| institute |
| referrer(ref auth_user) |
| codechef_handle(ref handle) |
| codeforces_handle(ref handle) |
| spoj_handle(ref handle) |
| hackerearth_handle(ref handle) |
| hackerrank_handle(ref handle) |
| handle |
|---|
| name |
| site |
| problem |
|---|
| name |
| link |
| tags |
| site |
| submission |
|---|
| stopstalk_handle |
| submission_handle(ref handle) |
| time_stamp |
| problem(ref problem) |
| lang |
| status |
| points |
| view_link |
| custom_friend |
|---|
| user_id(ref auth_user) |
| first_name |
| last_name |
| institute |
| duplicate_cu(ref custom_friend) |
| referrer(ref auth_user) |
| codechef_handle(ref handle) |
| codeforces_handle(ref handle) |
| spoj_handle(ref handle) |
| hackerearth_handle(ref handle) |
| hackerrank_handle(ref handle) |
| trending_problem |
|---|
| problem_id (ref problem) |
| submission_count |
| user_count |