what is optimized for a faster database query, using JOINS or a seperate table with all relevant data
I'm trying to make my vCard
and it pretty much has redundant information. Like my name, number, website, company name, my title (or in my开发者_如何学编程 case my group name title)
These values exists in a few tables
user_meta
company
groups
I could easily just make a vCard table and house all that information in there, but is that a good way to go? Or should I just JOIN
to get the information from all 3 tables to populate my vCard.
Well, the question is what you do. Manage VCards - then go with the vcard oriented model. Manage information where vcard is the output, then maybe get a copy of the Data Model Ressource Book and look how to design a good address and contact maangement system (hint: it is a LITTLE more complicated).
In general, both approaches have merit. The problem with copying data are updates. It is often done when no / rare updaets happen, such as data warehouses. Joins keep the data size small, which makes processing easier, but require more processing power.
For a vcard management system I doubt it makes a difference. How many hundred thousand people you plan to enter?
精彩评论