some time ago, I created for my own use a flash card system; My friend liked it, so i want to make it public (online).
My version it’s a quick and ugly hack that does not require a database, but a database it’s needed for an web version.
I am wondering how I could design that.
item table:
item guid, question, answer, other
item “tracking table”:
id, user id, item id, times wrong, last passed, next repetition, forgetting index, other
In this way, with 1000 items and 5000 users, it will make 5 millions entries.
I think that if i retrieve the data using
SELECT * FROM trackingtable WHERE `user-id` = 1 AND `item-id` = 1
it will be very slow, right?
It’s the right approach?
Make an index out of the user-id and item-id columns. It will be blazing fast, even for pretty large tables. Integer comparison on indexed columns is a cheap and fast operation, especially if the index fits in memory.