recently inserted a lot of rows into these tables and now the query times out:
SELECT * FROM eng
WHERE english IN (SELECT eng FROM `eng-jap`)
ORDER BY lastmodified DESC
table eng-jap has about 25,000 rows, here is some stats on it:
Format dynamic
Collation utf8_general_ci
Rows 24,960
Row length ø 316
Row size ø 328 B
Next Autoindex 26,468
Type Usage
Data 7,724.0 KiB
Index 264.0 KiB
Total 7,988.0 KiB
and for table eng:
Format dynamic
Collation utf8_general_ci
Rows 23,691
Row length ø 105
Row size ø 117 B
Next Autoindex 24,771
Type Usage
Data 2,451.4 KiB
Index 260.0 KiB
Total 2,711.4 KiB
just select * from table gets (Query took 0.0002 sec) for either table
i just cant believe a very simple subquery like this with a couple k’s in each table needs more than the 160 sec timeout i have set, and then times out…
i hope its like a setting in my tables thats causing it. or mysql really cant do a query like this?
It’s having to cross-reference all the elements from one table with all the elements of the other.
Perhaps this might work better:
Also make sure you have suitable Indexes defined. This will help speed up the query.