1) If you insert many rows from the same customer at the same time, use the INSERT statement for multiple value tables. This is faster than using separate INSERT statements (several times in some cases).
Insert into test values (1,3), (1,4) ...
2) If you insert many rows from different customers, you can get a higher speed by using the Insert delayed statement. The implication of delayed is that the INSERT statement executes immediately, but the data is placed in the queue of memory and is not actually written to the disk, which is much faster than inserting each statement, and Low_priority just the opposite, when all other users have finished reading and writing the table.
3) Place index files and data files on separate disks (using the options in the Build table).
4) If BULK INSERT, you can increase the value of the bulk_insert_buffer_size variable to increase the speed, however, this can only be used for the MyISAM table.
5) When loading a table from a text file, use load DATA INFILE. This is usually 20 times times faster than using many INSERT statements.
6) Use the Replace statement instead of INSERT, depending on the application.
7) Use the Ignore keyword to ignore duplicate records, depending on your application.