MYSQL autoincrement a column or just have an integer, difference?

Posted by David19801 on Stack Overflow See other posts from Stack Overflow or by David19801
Published on 2010-12-27T15:32:18Z Indexed on 2010/12/27 15:53 UTC
Read the original article Hit count: 159

Filed under:
|

Hi,

If I have a column, set as primary index, and set as INT.

If I don't set it as auto increment and just insert random integers which are unique into it, does that slow down future queries compared to autincrementing?

Does it speed things up if I run OPTIMIZE on a table with its primary and only index as INT? (assuming only 2 columns, and second column is just some INT value)

(the main worry is the upper limit on the autoincrement as theres lots of adds and deletes in my table)

© Stack Overflow or respective owner

Related posts about mysql

Related posts about mysql-query