Some useful MySQL tips
Tip 1: Optimize table primary key
It is recommended to use at least one unique index for every table. I am doing this by creating an autoincrement integer column (named usually “id”). If your table won’t exceed 16M rows, you may consider using MEDIUMINT, but if you have a smaller table that does not exceed 65k rows, consider SMALLINT type for index column.Only if that table grows very much, you should use INT, or BIGINT types. There are very few situations when BIGINT should be used, because INT normally covers 4G rows. These considerations keep performance on queries running on these table.
Tip 2: Signed or unsigned for integers ?
For integer type columns that contain positive numbers, always use UNSIGNED property for that type. For instance TINYINT [SIGNED] may use only 128 positive values, while TINYINT [UNSIGNED] doubles that range to 256. This principle is applicable to other integer types as well.
Tip 3: Run SQL file from command prompt in Windows
If you have to run a very large SQL query file, the most quick is to do it from command prompt, not from MySQL IDEs. Command to run a SQL file is:
mysql -u user -p < full_path_to_sql_file, then insert the mysql user password.

