Tag

duplicate-key

0 views collected around this technical thread.

Aikesheng Open Source Community
Aikesheng Open Source Community
Nov 13, 2024 · Databases

InnoDB Locking Analysis for INSERT … ON DUPLICATE KEY under REPEATABLE‑READ and READ‑COMMITTED

This article examines how InnoDB acquires row‑level locks during INSERT … ON DUPLICATE KEY operations under REPEATABLE‑READ and READ‑COMMITTED isolation levels, explains the lock types on primary and unique indexes, and shows the rollback and lock‑conversion process with concrete SQL examples.

InnoDBMySQLRead Committed
0 likes · 11 min read
InnoDB Locking Analysis for INSERT … ON DUPLICATE KEY under REPEATABLE‑READ and READ‑COMMITTED
Aikesheng Open Source Community
Aikesheng Open Source Community
Sep 4, 2024 · Databases

Understanding InnoDB Record Locking When Inserting Duplicate Primary Keys

This article examines how InnoDB acquires shared record locks during a duplicate‑primary‑key INSERT, explains the underlying lock‑checking mechanism, demonstrates lock behavior with concurrent DELETE and INSERT transactions, and provides SQL examples and performance_schema queries to illustrate the process.

InnoDBMySQLSQL
0 likes · 8 min read
Understanding InnoDB Record Locking When Inserting Duplicate Primary Keys
macrozheng
macrozheng
Jul 11, 2024 · Backend Development

Mastering Java Stream toMap: Handling Duplicate Keys and Null Values

This article explains how to convert a list of Java objects into a Map using Stream's toMap collector, addresses duplicate key exceptions, demonstrates providing a merge function, handling null values with Optional, and compares alternative approaches such as manual loops, offering complete code examples.

JavaOptionalStream
0 likes · 7 min read
Mastering Java Stream toMap: Handling Duplicate Keys and Null Values
Architecture Digest
Architecture Digest
Mar 15, 2021 · Databases

Impact of UNIQUE Indexes in MySQL and Strategies to Avoid Duplicate Key Errors

This article explains how MySQL UNIQUE indexes affect data insertion and auto‑increment behavior, compares them with primary keys, and presents three techniques—INSERT IGNORE, REPLACE INTO, and INSERT … ON DUPLICATE KEY UPDATE—to prevent duplicate‑key failures, including deadlock considerations.

DatabaseINSERT IGNOREMySQL
0 likes · 8 min read
Impact of UNIQUE Indexes in MySQL and Strategies to Avoid Duplicate Key Errors
Tencent Database Technology
Tencent Database Technology
Dec 3, 2018 · Databases

Investigation of Duplicate Key Errors After MySQL 5.6→5.7 Upgrade and Auto‑Increment Bugs

The article analyzes why MySQL tables upgraded from 5.6 to 5.7 began generating duplicate‑key errors during inserts, examines related InnoDB auto‑increment mechanisms, reproduces the issue, discusses known bugs (including replace‑into replication problems), and proposes both operational and kernel‑level solutions.

Bug AnalysisInnoDBMySQL
0 likes · 13 min read
Investigation of Duplicate Key Errors After MySQL 5.6→5.7 Upgrade and Auto‑Increment Bugs