Re: [PHP-DB] One field or a new table?

[email protected] (Thodoris)
Newsgroups php.db
Message-ID <[email protected]>
  I am tempted to say that you can test both by benchmarking them. I 
assume that you need this to be fast since many users use it, so try 
both ways and see what it is better. Have in mind that the underlying 
engine is important when designing something that gets heavy use. I get 
the feeling that if the collectibles are few say 10-15 in that case 
adding a field tends to be a better idea.
You can benchmark this by counting the time that you select and extract 
the collectibles in an array in either way. I assume that you will need 
to select from two tables user and collectibles in case you separate 
them. This is probably slower if the collectibles are few in number but 
I think it gets better when their number increases badly.

Tell us what you think.

-- 
Thodoris



O/H Hussein Jafferjee ??????:
> Hey Guys,
>
>  
>
> I have been developing for a while and never found the best solution yet.
> The question is lets say a game has 10 collectibles you can earn, to keep
> track of the number of collectibles each user has, do you have one field in
> the users table with all the numbers separated via a divider, or do you make
> a new table called collectibles and have each one as a field?
>
>  
>
> These are high traffic sites (100,000+ people) and so I was initially
> thinking the solution of creating a separate table is best because the main
> users row is loaded on every page, and on top of that you would need to use
> explode on the field.
>
>  
>
> Currently I am having a separate table, but I was wondering if people have
> better solutions.
>
>  
>
> Hussein J.
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.