Fixed a bug where MySQL insertion was slow