Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Database question!

Featured Replies

Hi all!

 

I'm creating a personal project website in Drupal which may, or may not ever go live. It contains various quiz-like games to help memory where users can register and save their scores etc. I want to keep a record ideally of all the scores they submit so they can see improvement, displayed in graphs, and compare with other users etc.

 

As I don't have have much experience in db design, I was wondering what would be the most efficient way of building the score table/tables. My main concern is that the table could become huge, with possible many users, many different quizzes, and multiple entries, and may be slow to query.

 

Currently I have one table with columns (or their Drupal equivalents) User ID, Game ID, Score, Time taken, and timestamp, with every submission being dumped into it. This is working well form now, but wonder what it will be like if it becomes massive. Is there a better way to be doing this, or does this sound alright?

 

Thanks!

Sounds about right to me, but then again I'm no expert.

Unless you have some idea to re-use the old data

I would say delete any entry over six months old.

I would split the database up if you think you need more speed. It depends how many entries you think you may have but you can speed things up considerably by splitting up the tables, maybe a different one for each month or something but if you are just dealing in numbers then it will still be fast even with 100,000 or so rows.

  • Author

I would split the database up if you think you need more speed. It depends how many entries you think you may have but you can speed things up considerably by splitting up the tables, maybe a different one for each month or something but if you are just dealing in numbers then it will still be fast even with 100,000 or so rows.

 

Ah right I think thats what I needed to know. If it starts getting big then I'll think about it it then :)

maybe by each month isnt the right word, but if you have millions of records you can speed things up considerably by splitting the tables up and calling the relevant table, searching a much smaller dataset. eg if he only wants to call the data from this month then there is no point in searching through months and months of records.

maybe by each month isnt the right word, but if you have millions of records you can speed things up considerably by splitting the tables up and calling the relevant table, searching a much smaller dataset. eg if he only wants to call the data from this month then there is no point in searching through months and months of records.

Um im pretty sure this don't speed up anything

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.