stopstalk-deployment icon indicating copy to clipboard operation
stopstalk-deployment copied to clipboard

Whole new DB schema. Maybe a lot efficient, faster and less memory consuming.

Open raj454raj opened this issue 9 years ago • 1 comments
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.

raj454raj avatar Feb 28 '16 20:02 raj454raj

New proposed schema:

auth_user
first_name
last_name
email
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

raj454raj avatar Mar 18 '16 12:03 raj454raj