Re: business users services
Posted by:
Rick James
Date: August 31, 2014 05:56PM
> So,changing the data type for b_users means changing it also for the user_id...given the fact that the users table contains all the users of the site(business users and regular users),which means a bigger INT is required,do you still think is a good idea to use MEDIUMINT or SMALLINT?
True. You would need to change it consistently across all tables where it is used. And it would need to be big enough for all reasonable growth.
If there is a chance that 16 million won't be enough, then leave it as INT.
If 64K is risky, 16M might be a safe limit.
It all depends on your application. I have some ids that are safely declared TINYINT UNSIGNED (0..255).
I almost never see a real need for BIGINT -- which is needed if you expect to go beyond 4 billion (the limit if INT UNSIGNED).
(Note that your INTs are SIGNED, with a range of -2 billion to +2 billion. UNSIGNED is better for ids, but that is not a big deal here.)
Another cautionary note:
> `price` decimal(6,2) DEFAULT NULL
Will the price never go over 9999.99?
Will you never have to use non-Euro / non-dollar currency? Some currencies need more decimal places than 2.
Subject
Written By
Posted
Re: business users services
August 31, 2014 05:56PM
September 03, 2014 01:55AM
September 05, 2014 01:22PM
September 22, 2014 11:43AM
September 25, 2014 04:07PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.