database - When setting MySQL schema, why use certain types? -


When I am setting up a MySQL table, let me type the column name, type of input, and length. My assumption, do not read anything about it, it is at least, specify the smallest possible int / small / small thing for your needs, and it will reduce any kind of upper part. If all this is positive, then unsigned to double it in its place, etc.

What if I make every area a varchar-200 character? When / Why is it bad, what will I not remember, and when any incompetence will manifest itself? 100k record?

I think about it whenever I had set up a DB, but I have not made enough scale, where I have never kept my plan inappropriately, either Can a "strong / small" or "loose / large" person confirm that I am making a good impression about speed and efficiency?

Thank you!

Data types not only optimize the storage, but how data is indexed. As your database grows up, it will become clear that they are fast to find all those records which have more than 1 in an integer field, which have "1" in the curved area. This is especially important when you get involved in data from more than one table and your database engine has to do this type of thing over and over again (Darren also correctly states that it is important that you are matched The types of areas going are the same.)

At the level of which these disabilities become a problem, it is your hardware and your application design, nowadays we have a large iron The If you are building middle-tier application, probably you will not find any difference. (In addition to feeling a little guilty about designing your database!) But making good practice on small projects makes it easy for a large number of people to come up with.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -