mysql medium int vs. int performance?

Posted by aviv on Stack Overflow See other posts from Stack Overflow or by aviv
Published on 2010-05-22T09:47:23Z Indexed on 2010/05/22 9:50 UTC
Read the original article Hit count: 365

Hi,

I have a simple users table, i guess the maximum users i am going to have is 300,000.

Currently i am using:

 CREATE TABLE users
 (
         id INT UNSIGEND AUTOINCEREMENT PRIMARY KEY,
         ....

Of course i have many other tables that the users(id) is a FOREIGN KEY in them.

I read that since the id is not going to use the full maximum of INT it is better to use: MEDIUMINT and it will give better performance.

Is it true?

(I am using mysql on Windows Server 2008)

Thanks.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about Performance