Tag

TRUNCATE

1 views collected around this technical thread.

Java Tech Enthusiast
Java Tech Enthusiast
Jun 8, 2025 · Databases

Why DELETE Is Discouraged in MySQL and When to Use DROP or TRUNCATE

This article explains MySQL's storage architecture, compares the DELETE, TRUNCATE, and DROP commands, shows their performance and side‑effects, and provides practical guidance on choosing the safest and most efficient way to remove data from a MySQL table.

DELETEDROPDatabase Storage
0 likes · 9 min read
Why DELETE Is Discouraged in MySQL and When to Use DROP or TRUNCATE
Aikesheng Open Source Community
Aikesheng Open Source Community
Nov 26, 2024 · Databases

Performance Issues of TRUNCATE/DROP TABLE in MySQL and Their Historical Fixes

This article reviews the long‑standing performance problems of TRUNCATE and DROP TABLE in MySQL, tracing their origins through official manuals and historical bugs, summarizing the optimizations introduced in MySQL 5.5.23, 5.7, 8.0, and 8.4, and offering practical guidance for mitigating remaining latency.

Adaptive Hash IndexDrop TableInnoDB
0 likes · 12 min read
Performance Issues of TRUNCATE/DROP TABLE in MySQL and Their Historical Fixes
Selected Java Interview Questions
Selected Java Interview Questions
Oct 17, 2023 · Databases

SQL Techniques: Finding Duplicate Records, TRUNCATE vs DELETE, Primary vs Candidate Keys, Second Highest Salary, and Common Interview Queries

This article explains how to locate duplicate rows in a table, contrasts TRUNCATE and DELETE commands, clarifies the difference between primary and candidate keys, demonstrates queries for retrieving the second highest salary, and provides a collection of typical SQL interview questions with sample code.

DatabaseDuplicate RecordsInterview Questions
0 likes · 9 min read
SQL Techniques: Finding Duplicate Records, TRUNCATE vs DELETE, Primary vs Candidate Keys, Second Highest Salary, and Common Interview Queries
Laravel Tech Community
Laravel Tech Community
Aug 3, 2023 · Databases

MySQL Data Deletion Methods: DELETE, TRUNCATE, and DROP

This article explains the three primary ways to delete data in MySQL—using DELETE, TRUNCATE, and DROP—detailing their execution speed, underlying mechanisms, storage‑engine differences, and best‑practice considerations such as space reclamation and auto‑increment handling.

DELETEDROPDatabase
0 likes · 5 min read
MySQL Data Deletion Methods: DELETE, TRUNCATE, and DROP
Aikesheng Open Source Community
Aikesheng Open Source Community
Jun 19, 2023 · Databases

Analysis of Slow TRUNCATE and DROP TABLE Operations in MySQL 5.7 and 8.0

This article investigates why TRUNCATE and DROP TABLE statements appear in MySQL slow‑query logs, analyzes the internal execution paths and performance bottlenecks in MySQL 5.7 and 8.0, and proposes configuration‑based optimizations and debugging techniques to mitigate the latency.

Database OptimizationDrop TableInnoDB
0 likes · 13 min read
Analysis of Slow TRUNCATE and DROP TABLE Operations in MySQL 5.7 and 8.0
Aikesheng Open Source Community
Aikesheng Open Source Community
Apr 20, 2023 · Databases

Safely Dropping a Large MySQL history_str Table to Reclaim Disk Space

This article describes a step‑by‑step procedure for safely dropping a massive MySQL history_str table—including creating a new table, renaming, using hard links, staged drops, and a truncate script—to avoid instance hangs, replication lag, and I/O pressure while freeing disk space.

DBADisk SpaceDrop Table
0 likes · 9 min read
Safely Dropping a Large MySQL history_str Table to Reclaim Disk Space
Laravel Tech Community
Laravel Tech Community
Sep 8, 2022 · Databases

Understanding MySQL Data Deletion Methods: DELETE, TRUNCATE, and DROP

The article explains the three primary MySQL data removal commands—DELETE, TRUNCATE, and DROP—detailing their execution speed, underlying mechanisms, impact on disk space for InnoDB and MyISAM engines, and best‑practice usage such as running OPTIMIZE TABLE after DELETE.

DELETEDROPInnoDB
0 likes · 7 min read
Understanding MySQL Data Deletion Methods: DELETE, TRUNCATE, and DROP
Aikesheng Open Source Community
Aikesheng Open Source Community
Jul 4, 2022 · Databases

Managing and Truncating InnoDB Undo Logs in MySQL 5.7 and 8.0

This article explains why undo logs can grow uncontrollably in MySQL, demonstrates how to verify and accelerate undo log truncation by adjusting purge settings in MySQL 5.7, and shows the new manual undo‑tablespace management commands introduced in MySQL 8.0.

Database AdministrationInnoDBMySQL
0 likes · 7 min read
Managing and Truncating InnoDB Undo Logs in MySQL 5.7 and 8.0
Aikesheng Open Source Community
Aikesheng Open Source Community
Dec 17, 2021 · Databases

Root Cause Analysis of Missing Data Using MySQL Binlog Parsing

This article presents a step‑by‑step investigation of a data‑loss incident in a MySQL table by examining binlog files, identifying unintended TRUNCATE operations, and offering practical binlog‑parsing techniques and configuration tips for reliable troubleshooting.

Data LossDatabaseMySQL
0 likes · 8 min read
Root Cause Analysis of Missing Data Using MySQL Binlog Parsing
Architecture & Thinking
Architecture & Thinking
Dec 1, 2021 · Databases

Master MySQL DML: Insert, Update, Delete, and Truncate Explained

Learn the essential MySQL Data Manipulation Language commands—INSERT, UPDATE, DELETE, and TRUNCATE—including syntax variations, best practices, and step‑by‑step command‑line examples that illustrate single‑row, batch, and conditional operations, plus key differences between delete and truncate.

DELETEDMLDatabase
0 likes · 12 min read
Master MySQL DML: Insert, Update, Delete, and Truncate Explained
Qunar Tech Salon
Qunar Tech Salon
Sep 9, 2021 · Databases

InnoDB Startup Hang Analysis: Truncate, Flush Sync, and Debugging Strategies

An in-depth investigation of a MySQL InnoDB startup deadlock caused by truncate operations and the innodb_flush_sync parameter, detailing log observations, stack traces, source code examination, and three practical solutions including GDB intervention, parameter adjustment, and data directory cleanup.

InnoDBMySQLTRUNCATE
0 likes · 15 min read
InnoDB Startup Hang Analysis: Truncate, Flush Sync, and Debugging Strategies
Selected Java Interview Questions
Selected Java Interview Questions
Oct 18, 2020 · Databases

MySQL Data Deletion Methods: DELETE, TRUNCATE, and DROP

This article explains the three primary ways to remove data in MySQL—DELETE, TRUNCATE, and DROP—comparing their execution speed, underlying mechanisms, impact on disk space, transaction behavior, and how to reclaim space with OPTIMIZE, while providing practical SQL examples and usage warnings.

DELETEDROPDatabase
0 likes · 6 min read
MySQL Data Deletion Methods: DELETE, TRUNCATE, and DROP