Be wary of locks

When MySQL updates a table, it performs what is called a "lock" - it ensures that no other program can read or write from the table while it updates. As soon as MySQL has finished writing, it allows access again. So, it is best not to try to perform complicated SELECT statements (reads) on tables which are updated regularly, because your SELECT statement will stall.

 

Want to learn PHP 7?

Hacking with PHP has been fully updated for PHP 7, and is now available as a downloadable PDF. Get over 1200 pages of hands-on PHP learning today!

If this was helpful, please take a moment to tell others about Hacking with PHP by tweeting about it!

Next chapter: Consider switching OS >>

Previous chapter: Consider splitting off variable-length fields

Jump to:

 

Home: Table of Contents

Copyright ©2015 Paul Hudson. Follow me: @twostraws.