why does create index with SET FOREIGN_KEY_CHECKS=0; and SET UNIQUE_CHECKS = 0; take a lot of time?
SET FOREIGN_KEY_CHECKS=0; and SET UNIQUE_CHECKS = 0; are meant for speeding up imports (typically INSERT statements) into tables where foreign keys and unique indexes already exist. They are not meant to speed up the creation of indexes.