Monty <mailto:[EMAIL PROTECTED]>
    on Monday, February 23, 2004 2:35 PM said:

> I'm wondering if I will see any noticeable speed increase if I were
> to split the 20+ fields that hold preferences (nearly all are
> single-digit 1/0 fields) out from the other fields that hold general
> member data, and put them into their own table? Or maybe there's some
> other good reason for doing this that I'm not aware of?
> 
> I'd actually prefer to keep it all together, because it's a lot
> easier to update a single table in MySQL than several if a member
> makes changes to their account or preferences.
> 
> What do you think?

what do *i* think?? well, i'll tell you.

i'd say you should definitely keep them in the same table. once you move
them to another table you'll need some way of keeping track of each
users corresponding settings and the way to do that is to have some kind
of unique identifying field that is the same between both tables. this
is usually done with an auto-incrementing ID field.

you will likely not see any performance increase if you split the
tables. in fact you'll probably see a decrase as you'll have to do a
join to get data from two tables at once.

and just to let you know (in case you don't already):

1. don't select the entire table with "SELECT * FROM user_data". instead
you should explicitly list each and every field you want to grab (even
if it's all of them).

2. in case you are not meaning to select the entire table but you are
still doing SELECT *, you'd be much better off following tip #1 because
the database won't be doing as much work.



hth,
chris.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to