MySQL, Query, Optimization, Web Performance, Database.
replace ins with in. 3, the field definition is a string, the query is not quoted, will not use the index, will be full-text scanning. 4, try to use table variables instead of temporary tables 5, to avoid frequent creation and deletion of temporary tables to reduce the consumption of system table