David Zhu wrote in post #971909:
> Hello,
>
> I have a user table that stores their username, email address, and
> password. (along with salt, etc)
>
> However, now I want to have more complex information associated with
> each user (address, etc). I'm no DBA expert, so in terms of
> performance, which is better:
>
> - A user table that has all the fields in it (Username, Email,
> password, country, state, zipcode, etc)
> - A user table that only has username/password/email, that is
> connected via a foreign key to another table that stores all the other
> fields.
>
> Which is better? And why?

The first will be slightly better in terms of performance, because 
you're not joining tables.  But if your tables are properly indexed, the 
join should have a negligible effect on performance.

However, I don't see why you'd use the second approach.  It's more 
complex for no particular gain.

>
> Thank you
>
> -David Zhu

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to