Jump to content

Recommended Posts

I've got about 5,000 integers that need to be checked if a user has seen before. These integers are grouped into different categories of varying size, so one category could contain 325 of the integers while another has 50 of them.

 

They're all unique integers and won't appear in any category more than once. Meaning that if it's in one category, it's only in that category.

 

Right now I have a table setup to contain the following:

 

user_id | category_1 | category_2 | category_3 | category_n... etc

 

In category_1 there's just a comma separated list of integers that the user has seen before.

 

eg. 1,2,3,5,6,7,111,9,10

 

This seems a bit clunky so I'm thinking about storing each individual integer seen in its own row. Kind of like this.

 

user_id | int_seen | category

 

The only problem I can think of is that there could be any number of user_ids... It'd probably be capped at 10,000 but that'd still be 50,000,000 entries in the table...

 

My solution to that would be clearing the table of a specific user_id's entries when they have seen all the integers and making another table that contains a list of users that have done this.

 

That and maybe having a group_id column in the original table so people in a group can share a result set instead.

 

What do you guys think? Any ideas or alternatives?

 

edit: hope that made sense

Link to comment
https://forums.phpfreaks.com/topic/166276-large-sets-of-results/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.