Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To answer your question: yes it'll get less performant. Obviously, the bigger the type, the bigger the table, the slower the queries (more I/O, bigger indexes, longer access time, result less likely to fit in the various caches, and so on). So as a rule of thumb: always use the <strong>smallest type</strong> that fits you need.</p> <p>That being said, <strong>performance doesn't matter</strong>. Why? Because when you reach a point where you overflow an INT, then BIGINT is the only solution and you'll have to live with it. Also at that point (considering you're using an auto increment PK, you'll be over 4 <strong>billions</strong> rows), you'll have bigger performance issues, and the overhead of a BIGINT compared to a INT will be the least of your concerns.</p> <p>So, consider the following points:</p> <ul> <li>Use UNSIGNED if you don't need negative values, that'll double the limit.</li> <li>UNSIGNED INT max value is 4.294.967.295. If you're using an auto increment PK, and <strong>you only have 300.000 entries, you really don't need to worry</strong>. You could even use a MEDIUMINT at the moment, unless you're planning for really really fast growth. (see <a href="http://dev.mysql.com/doc/refman/5.1/en/integer-types.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.1/en/integer-types.html</a>)</li> <li>The number in parenthesis after the type <strong>doesn't impact the max value of the type</strong>. INT(7) is the same as INT(8) or INT(32). It's used to indicate the display width if you specify ZEROFILL (see <a href="http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.1/en/numeric-type-overview.html</a>)</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload