Multiple row operations are in common use in a normalized application databases as one database entity is often linked to multiple sub-entities (for example a user and his tags). By row operations I’m referring to write queries, namely UPDATE and INSERT queries (DELETE is less interesting so I’ll leave it out for now).
Too often I’ve seen such queries ran in long loops one at a time, which is very bad for performance (as I will show here) and sometimes equally bad for integrity (if the process is interrupted). So what are the alternatives?
Continue reading Multiple row operations in MySQL / PHP