Tagged articles
8 articles
Page 1 of 1
Sohu Tech Products
Sohu Tech Products
Jan 8, 2025 · Databases

Analysis of MySQL Deadlock Issues in Multi-threaded Scenarios

The article investigates a MySQL deadlock that arises when multiple threads concurrently execute INSERT … ON DUPLICATE KEY UPDATE for logistics cancellations, reproduces the issue on MySQL 5.7 and 8.0, analyzes InnoDB lock handling and internal mini‑transactions, and explains how batch processing of each value leads to the deadlock.

ON DUPLICATE KEY UPDATEdeadlocklocking mechanism
0 likes · 18 min read
Analysis of MySQL Deadlock Issues in Multi-threaded Scenarios
Aikesheng Open Source Community
Aikesheng Open Source Community
Jan 31, 2023 · Databases

Useful MySQL Functions and SQL Techniques for Data Manipulation

This article presents a collection of practical MySQL functions and SQL commands—including GROUP_CONCAT, CHAR_LENGTH, LOCATE, REPLACE, NOW, INSERT…SELECT, INSERT…IGNORE, SELECT FOR UPDATE, ON DUPLICATE KEY UPDATE, SHOW CREATE TABLE, CREATE TABLE … SELECT, EXPLAIN, SHOW PROCESSLIST, and mysqldump—explaining their purposes, usage patterns, and providing concrete example queries with results.

GROUP_CONCATON DUPLICATE KEY UPDATESQL
0 likes · 13 min read
Useful MySQL Functions and SQL Techniques for Data Manipulation
Java Architect Essentials
Java Architect Essentials
Jul 30, 2021 · Databases

How to Insert Non‑Duplicate Data in MySQL Using INSERT IGNORE, ON DUPLICATE KEY UPDATE, and REPLACE INTO

This article explains several MySQL techniques—INSERT IGNORE, ON DUPLICATE KEY UPDATE, and REPLACE INTO—to efficiently insert large volumes of data while preventing duplicate primary‑key or unique‑key rows, and provides practical code examples for single and batch operations.

INSERT IGNOREON DUPLICATE KEY UPDATEREPLACE INTO
0 likes · 6 min read
How to Insert Non‑Duplicate Data in MySQL Using INSERT IGNORE, ON DUPLICATE KEY UPDATE, and REPLACE INTO
Top Architect
Top Architect
Jul 11, 2021 · Databases

Handling Duplicate Inserts in MySQL: Strategies and MyBatis Batch Example

The article discusses efficient ways to perform bulk inserts in MySQL while avoiding duplicate records, covering techniques such as INSERT IGNORE, ON DUPLICATE KEY UPDATE, INSERT…SELECT…WHERE NOT EXISTS, REPLACE INTO, and demonstrates a practical MyBatis implementation with a unique mobile_number constraint.

Batch InsertINSERT IGNOREMyBatis
0 likes · 5 min read
Handling Duplicate Inserts in MySQL: Strategies and MyBatis Batch Example
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Aug 7, 2020 · Databases

Four Common MySQL Insert Statements and Their Usage

This article explains the four frequently used MySQL data‑insertion statements—INSERT, INSERT SELECT, REPLACE INTO, and INSERT … ON DUPLICATE KEY UPDATE—detailing their syntax, options, behavior, and performance considerations for reliable database operations.

InsertON DUPLICATE KEY UPDATESQL
0 likes · 7 min read
Four Common MySQL Insert Statements and Their Usage