Re: How does mysql work ?
Posted by:
Rick James
Date: February 12, 2014 11:46AM
> Error on delete of '/tmp/#sql_7bd62_0.MYD' (Errcode: 2)
That is a temp file (table) used in support of a complex SELECT. Let's see the SELECT.
True, the file should not be deleted twice.
Check the permissions on /tmp. It should include "s".
> The whole process. from query to results.
That's a long discussion. And there are many possible paths it could take. If you provide a SELECT and the SHOW CREATE TABLE for the table(s) involved and the output of EXPLAIN on that SELECT, we can walk you through that example.
Possible paths involve:
* InnoDB vs MyISAM vs MEMORY
* JOIN (or not)
* UNION (or not)
* PARTITIONing (especially 'pruning')
* Subqueries (correlated, uncorrelated, etc)
* GROUP BY, ORDER BY, HAVING, LIMIT, EXISTS
* Indexes, PRIMARY KEY, clustered index, index-only, "index merge", MBR, ICP, etc.
If you want the "whole process", then see the online manual, the performanceblog site, comments in this forum, and many other places.