Database table relationship [closed]

0

I have a registration form where it contains personal, professional, additional, financial and production information, my doubt, as it gives many columns, I believe more than 50 fields.

Is it advisable to leave everything on a table? Or separate them and relate 1: 1?

    
asked by anonymous 10.08.2016 / 03:00

1 answer

1

Is there any reason to separate? This is the question. Almost always does not have to. There is usually a small loss of performance (in some cases there may be improvement, but you would have to analyze the problem, it is not common) since you would want to read more than one different log, having to do separate searches. would have an extra complication in the consultations. Why do that then? What is the gain?

It may even be that you want to build a logical model where it will be separate, but the physical model (which counts the most for the database, and many developers think it exists) does not usually benefit from this.

Whatever you decide to do, you have to ask yourself why. If you do it for free, you should not do it. If you can not explain a reason or have read somewhere ordering and have not seen a plausible explanation of why you should do it, you should not. Unfortunately we sometimes find recommendations, usually called "good practices," even with plausible explanations, but either they are wrong or they do not apply to the context the inexperienced programmer is facing.

If the database allows hundreds of columns, you can use them. To tell you the truth, it is very common that tables usually have 10 more columns, so it seems to me that this is not too much, on the contrary. Even if it were, it would still have to technically justify the decision to separate, which is often difficult because it is almost always "wrong."

If you still have questions and have a more concrete example you can ask us a new question to review. But it is very likely that the answer is still to keep a table alone.

    
10.08.2016 / 03:08