PDF (A4) - 40.5Mb
Man Pages (TGZ) - 259.5Kb
Man Pages (Zip) - 366.7Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb
TheMyISAM storage engine supports concurrent inserts to reduce contention between readers and writers for a given table: If aMyISAM table has no holes in the data file (deleted rows in the middle), anINSERT statement can be executed to add rows to the end of the table at the same time thatSELECT statements are reading rows from the table. If there are multipleINSERT statements, they are queued and performed in sequence, concurrently with theSELECT statements. The results of a concurrentINSERT may not be visible immediately.
Theconcurrent_insert system variable can be set to modify the concurrent-insert processing. By default, the variable is set toAUTO (or 1) and concurrent inserts are handled as just described. Ifconcurrent_insert is set toNEVER (or 0), concurrent inserts are disabled. If the variable is set toALWAYS (or 2), concurrent inserts at the end of the table are permitted even for tables that have deleted rows. See also the description of theconcurrent_insert system variable.
If you are using the binary log, concurrent inserts are converted to normal inserts forCREATE ... SELECT orINSERT ... SELECT statements. This is done to ensure that you can re-create an exact copy of your tables by applying the log during a backup operation. SeeSection 7.4.4, “The Binary Log”. In addition, for those statements a read lock is placed on the selected-from table such that inserts into that table are blocked. The effect is that concurrent inserts for that table must wait as well.
WithLOAD DATA, if you specifyCONCURRENT with aMyISAM table that satisfies the condition for concurrent inserts (that is, it contains no free blocks in the middle), other sessions can retrieve data from the table whileLOAD DATA is executing. Use of theCONCURRENT option affects the performance ofLOAD DATA a bit, even if no other session is using the table at the same time.
If you specifyHIGH_PRIORITY, it overrides the effect of the--low-priority-updates option if the server was started with that option. It also causes concurrent inserts not to be used.
ForLOCK TABLE, the difference betweenREAD LOCAL andREAD is thatREAD LOCAL permits nonconflictingINSERT statements (concurrent inserts) to execute while the lock is held. However, this cannot be used if you are going to manipulate the database using processes external to the server while you hold the lock.
PDF (A4) - 40.5Mb
Man Pages (TGZ) - 259.5Kb
Man Pages (Zip) - 366.7Kb
Info (Gzip) - 4.1Mb
Info (Zip) - 4.1Mb