MySQL view processing algorithms
I had a last work session last night, troubleshooting one of the project’s database performance issues. Â Without giving more details (at least for now), I want to save the link to MySQL view processing algorithms for future me.
For
UNDEFINED, MySQL chooses which algorithm to use. It prefersMERGEoverTEMPTABLEif possible, becauseMERGEis usually more efficient and because a view cannot be updatable if a temporary table is used.A reason to choose
TEMPTABLEexplicitly is that locks can be released on underlying tables after the temporary table has been created and before it is used to finish processing the statement. This might result in quicker lock release than theMERGEalgorithm so that other clients that use the view are not blocked as long.
A particular heavy query, using views, kept going into “Copying to tmp table” state, locking up the server and slowing everything to a crawl. Â Upon closer examination, the view was created without specifying the algorithm (UNDEFINED). Â Changing the view to use TEMPTABLE made everything so much faster.
I knew there were reasons for me being against using views in MySQL, but I could never remember them. Â This is one. Â Views not supporting indexes is another.
Thinking shisha
Your entire PC in a mouse
Awesome find via Slashdot: Your entire PC in a mouse
The Mouse-Box’s basic specifications are listed below.
- 1.4GHz ARM Cortex CPU
- 128GB flash storage (cloud storage optional)
- Micro HDMI port
- Wi-Fi connectivity
- 2 x USB 3.0 ports
Work is also underway to include a wireless mouse pad charger

