database - MySQL primary key column type for large tables -
I am working on a project with a larger DB table ( 700K rows ).
The mistake, I designed the DB schema when the rows were increasing, I had to increase the column type BigType ( x ) of the ID.
Now it is bigger (44). I'm afraid to set high x values because I thought it could slow down the display. Maybe I'm wrong ..
Please help me solve the problem.
What type of column can I set up once and forget this problem?
Should I learn better in the field of DB Schema Design?
When you have the width of display BIGINT (44) "44" It does not affect the range of values that you can store or the speed they can get.
For an Auto-Enerling ID you want to use a UNSIGNED number, eg BIGINT (44) UNSIGNED . This will double the boundaries of values and add an extra hurdle, which is usually a good thing.
An unsigned INT will store up to 4,294,967,295 to store an unsigned BIGINT 18,446,744,073,70 9,551,615 - You are not going to fill out anytime soon.
You do not say how fast your maximum id is growing - if you are not inserting multiple rows then you should stay with UNSIGNED INT less space Takes.
Comments
Post a Comment