// reset table id from 1 ALTER TABLE tablename AUTO_INCREMENT = 1
MySQL multiple columns in IN clause https://stackoverflow.com/questions/44706196/mysql-multiple-columns-in-in-clause (x0, y0, x1, y1) IN ((4, 3, 5, 6),(9, 3, 2, 1))
for string, need to be ... IN ('something1', 'something2') ...
OR EXISTS ( SELECT DISTINCT t., tt., tr.* FROM ".$table_prefix."terms AS t INNER JOIN ".$table_prefix."term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN ".$table_prefix."term_relationships AS tr ON tt.term_taxonomy_id = tr.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'person-types') and t.name like '%".$tag."%' )
Query Time for reference SELECT DISTINCT pm.* FROM something_postmeta AS pm 0.0002s
SELECT SQL_CALC_FOUND_ROWS something_posts.* FROM something_posts WHERE 1=1 0.0012 seconds
SELECT something_posts.* FROM something_posts WHERE 1=1 0.0006 seconds.
SELECT something_posts.* FROM something_posts WHERE ID > 100 LIMIT 10;