This article analyzes a real‑world incident where using INSERT INTO SELECT to migrate large order data caused full‑table scans and locking in MySQL, explains the underlying lock behavior, and presents a solution that adds an index and forces its use to avoid the problem.
This article explains how Kafka partitions data into segments, stores each segment as paired index and log files, and uses sparse indexing to enable efficient queries, illustrating the process with examples and diagrams of segment layout and offset lookup.
The article demonstrates how moving the LIMIT‑OFFSET condition into a subquery that selects only primary‑key IDs and then joining back to the main table can cut execution time from over 16 seconds to a few hundred milliseconds by avoiding massive index and data‑page scans.
This article provides a comprehensive overview of the JAR file format, detailing the structure and purpose of the META-INF directory, manifest sections, signing files, index files, class‑path attributes, and service provider configuration, while also presenting the formal syntax specifications and examples for each component.
This article explains why using indexes does not guarantee fast queries in MySQL, analyzes full index scans, index selectivity, the cost of row look‑ups (back‑to‑table), and presents optimization techniques such as index condition pushdown and virtual columns to improve performance.
This article analyzes MySQL data‑update loss caused by writes on master‑slave pairs, explains BEFORE and AFTER IMAGE handling in row‑based binlogs, examines the binlog_row_image and slave_rows_search_algorithms parameters, and details the implementation of hash, index, and table scans during slave replay.
This comprehensive guide covers MySQL index creation syntax, various index types—including primary, unique, full‑text, and composite—explains their advantages and drawbacks, details underlying B‑Tree and B+Tree structures, and provides practical strategies and optimization tips for effective index usage.
This article explains MySQL's B‑Tree index structure, describes various index types such as primary, unique, normal, full‑text, and composite indexes, and provides practical techniques for creating efficient indexes, choosing column order, using prefix and covering indexes, and optimizing query sorting.
This article explains MySQL index structures—including B‑Tree, B+Tree, and hash indexes—their underlying principles, performance characteristics, and practical usage guidelines such as left‑most prefix, full‑text indexing, and common pitfalls, providing a comprehensive guide for database developers.
This article explains Kafka’s workflow, detailing how topics, partitions, and segments are organized, the structure of index and log files, message composition, offset-based retrieval, and the overall data directory layout, providing a comprehensive overview of Kafka’s storage architecture.
This article walks through the evolution of MySQL index implementations—from hash tables and binary search trees to AVL, red‑black, B‑trees and finally B+ trees—explaining their performance trade‑offs, disk‑I/O considerations, and how InnoDB and MyISAM store data and indexes differently.
This article provides a concise tutorial on Elasticsearch 7.x, explaining what documents and indices are, how unique IDs and metadata work, and demonstrating key REST API commands for managing and querying data in a search‑engine context.
This article analyzes a slow MySQL view query caused by mismatched character sets, demonstrates how the automatic charset conversion prevents index usage, and shows step‑by‑step how altering the table charset and removing the conversion restores index usage and reduces execution time from seconds to fractions of a second.
This article explains what database indexes are, their advantages and disadvantages, when to create or avoid them, various index types, and practical SQL optimization techniques, including code examples for efficient pagination in MySQL.
A MySQL join between a large and a small table ran for seconds because differing character sets forced implicit conversions that disabled the index, and the article shows how to diagnose the issue with EXPLAIN, fix it by aligning charsets, and avoid similar pitfalls.
This article explains the internal B+Tree layout of InnoDB indexes, detailing page types, record organization, and how different primary‑key data types affect page density and overall index tree height, illustrated with concrete examples and visual diagrams.
An engineer’s mishap with a massive ‘INSERT INTO … SELECT’ migration exposed how full‑table scans lock MySQL tables, causing payment failures, and shows that adding an index on the filter column prevents the lock and ensures safe, efficient data transfer.
The article explains why using LIMIT with a large offset in MySQL causes severe performance degradation, demonstrates the problem with real data, and shows how rewriting the query with a sub‑query that selects only primary keys dramatically reduces execution time by avoiding massive random I/O and buffer‑pool pollution.
A developer used INSERT‑INTO‑SELECT to migrate millions of rows, unintentionally locking the source table and causing massive payment failures, but adding an index and forcing its use resolved the issue and restored safe migration.
A production database migration from MariaDB 10.4 to MySQL 5.7 caused a previously fast SQL query to become extremely slow due to differing column collations that prevented index usage, and the article explains how to diagnose the issue and resolve it by aligning collations or using explicit conversion.
This article explains why large OFFSET values in MySQL LIMIT queries cause severe performance degradation and demonstrates how rewriting the query to fetch primary keys first and then joining reduces execution time from seconds to milliseconds, supported by buffer‑pool analysis and practical test results.
This article examines why a MySQL query with a large OFFSET is extremely slow, demonstrates the performance gap with a join‑based rewrite, and validates the findings by comparing InnoDB buffer‑pool page usage, highlighting how unnecessary random I/O pollutes the cache.
This article explains MySQL storage engines, compares MyISAM and InnoDB, introduces the main index types—B‑Tree, Hash, Full‑text, R‑Tree—details the structures and characteristics of B‑Tree, B‑Tree and B+Tree, and outlines key principles for creating effective indexes.
This article explains what MySQL indexes are, the different categories such as ordinary, unique, composite, clustered and non‑clustered, how B‑Tree, B+Tree and hash indexes are implemented in InnoDB and MyISAM, and why auto‑increment primary keys are recommended for optimal performance.
This tutorial explains MySQL fundamentals, the advantages of using MySQL, detailed concepts of indexes, how they work, step‑by‑step SQL examples for creating, viewing, and dropping indexes, best‑practice principles, and query‑optimization techniques to improve performance.
This article analyzes a slow MySQL aggregation query that joins a large table with a derived table built from many UNION ALL subqueries, explains the execution plan and derived‑table materialization, and presents two optimization approaches—adding taskname indexes and rewriting the query or using a temporary indexed table—to dramatically reduce execution time while preserving result semantics.
This article analyzes a slow MySQL LEFT JOIN query, explains why the optimizer chose the inefficient Block Nested Loop algorithm instead of Index Nested Loop, shows how character‑set and collation differences cause index loss, and demonstrates how converting to INNER JOIN or fixing indexes restores high performance.
This article explains what database indexes are, why they are needed, the various index types and their characteristics, guidelines for choosing columns to index, and compares the performance of hash and B‑tree indexes in MySQL.
This article explains how MySQL InnoDB implements indexes with B+ trees, describes primary and secondary (clustered and non‑clustered) indexes, the concepts of row lookup, covering indexes, composite indexes, the left‑most prefix rule, index push‑down, and provides practical guidelines for creating and maintaining efficient indexes.
This article explains how using a large OFFSET in a MySQL LIMIT clause forces the server to scan hundreds of thousands of index and data pages, causing massive random I/O, and demonstrates a faster rewrite with an inner join that dramatically reduces buffer‑pool usage and execution time.
This article explains the fundamentals of MySQL indexing, tracing the evolution from binary search trees and balanced AVL trees to B‑trees and B+‑trees, and details how InnoDB implements clustered and non‑clustered indexes, including search processes and performance considerations.
This article explains why MySQL uses B+‑tree indexes by tracing the evolution from binary search trees through balanced trees and B‑trees, detailing the structure of clustered and non‑clustered indexes in InnoDB and illustrating how data is searched using these indexes.
This article explains the storage capacity of InnoDB B+‑tree indexes by detailing page size, record size, pointer calculations, tree height effects, and real‑world verification using page‑level metadata, showing that a typical B+‑tree can hold tens of millions of rows with only 1‑3 I/O operations.
Since MySQL 5.7 InnoDB builds secondary indexes using a bottom‑up, sorted‑index approach, the article explains the three build phases, presents a step‑by‑step B‑tree construction example with SQL code, and discusses the innodb_fill_factor setting, its impact, advantages, and drawbacks.
This comprehensive guide covers MySQL basics, including the definition of MySQL, transaction concepts and ACID properties, isolation levels, common concurrency issues, index structures and usage, storage engine differences, lock mechanisms, and practical techniques for optimizing large tables and improving performance.
This article provides a detailed technical analysis of Phoenix's native index creation and maintenance mechanisms, the underlying source code for index building, the role of coprocessors, and the complete SQL compilation pipeline from parsing to execution, highlighting how hints and optimizers influence index usage.
This article explains why MySQL queries can become slow—covering occasional delays from dirty‑page flushing or lock contention and persistent slowness caused by missing, unused, or mis‑chosen indexes—while offering practical tips such as checking process lists, correcting index usage, and refreshing statistics.
An online MySQL deadlock incident is dissected step‑by‑step, covering the error logs, InnoDB lock mechanisms, index structures, transaction isolation, execution plans, root causes, and practical solutions such as index redesign and transaction code adjustments to prevent future deadlocks.
This article examines MySQL indexing by exploring underlying data structures such as B‑Tree and B+Tree, common search algorithms, storage engine differences, and practical optimization techniques like composite and prefix indexes, providing a comprehensive guide for designing efficient database indexes.
This article provides a comprehensive guide to MySQL indexes, covering fundamental concepts, various index types, creation and design principles, practical optimization techniques, and the underlying data structures, illustrated with example tables, SQL statements, EXPLAIN analyses, and visual diagrams.
This article explains how InnoDB stores data pages, builds page directories, and uses B+‑tree indexes—including clustered, secondary, and composite indexes—to enable fast record lookup, while also covering MyISAM indexing differences and the SQL statements for creating and dropping indexes.
When paginating millions of rows in MySQL, avoid large OFFSET scans by using delayed joins or bookmark techniques that first fetch primary‑key values via covering indexes, then retrieve the needed rows, dramatically reducing I/O and query latency.
This article explains MySQL's index structures, how indexes accelerate queries but slow down writes, the differences between B‑tree and hash indexes, clustered versus non‑clustered indexes, the left‑most prefix rule, and provides a comprehensive overview of MySQL locking mechanisms and best practices.
This guide provides a comprehensive overview of MySQL fundamentals—including CRUD statements, table creation, index management, data manipulation, transaction control, stored procedures, and trigger creation—complete with syntax examples and practical tips for reliable database development.
This article explains how MySQL indexes work, why queries can become slow, how to interpret the EXPLAIN output—including id, select_type, table, type, possible_keys, key, key_len, ref, rows, and extra columns—and provides practical examples and optimization cases to improve query performance while balancing the cost of maintaining indexes.
This article compiles essential MySQL interview topics, covering ACID transaction properties, isolation levels and their issues, storage engine differences, index types, query execution order, lock mechanisms, temporary tables, normalization, read‑write splitting, performance tuning, and recovery logs, providing concise explanations and examples for each concept.
This article investigates the classic MySQL pagination “optimization” technique, reproduces tests on a low‑end server, compares plain LIMIT queries with the sub‑query rewrite on both clustered and non‑clustered indexes, and explains why the method sometimes improves performance and sometimes adds overhead.
This article analyzes why two similar MySQL SELECT statements return different rows by examining index structures, covering index behavior, the optimizer's choice of secondary versus primary keys, and experimental verification using EXPLAIN statements and index modifications.
This article explains how to use MySQL's EXPLAIN to verify index usage and outlines ten common situations—such as using !=, OR, functions, or low‑cardinality columns—that can cause indexes to become ineffective, helping developers and interviewees avoid performance pitfalls.
This guide explains MySQL B+Tree index structures, their advantages, how to create primary, unique, ordinary, full‑text, composite and prefix indexes, and provides practical rules and tips for designing efficient indexes, query patterns, and sorting strategies to dramatically improve database performance.
This guide explains how MySQL decides whether to use an index for range queries, LIKE patterns, and ORDER BY operations, detailing key_len calculation, index key vs filter vs table filter concepts, and practical examples for BETWEEN and sorting optimization.
This article walks through a real‑world Oracle pagination query that took over five seconds for just fifteen rows, analyzes why ORDER BY caused the slowdown, and demonstrates a step‑by‑step rewrite using a WITH clause and index‑driven access that reduces execution time to under one second.
A detailed Oracle case study shows how a seemingly harmless view modification triggered a cascade of performance regressions, how nested UNION ALLs, missing indexes, and optimizer choices prevented predicate pushdown, and the step‑by‑step rewrites—including hints, index creation, and scalar subqueries—that finally restored fast query execution.
This guide walks through MySQL fundamentals—including viewing, creating, and using databases, managing users and privileges, creating and altering tables, inserting, updating, deleting, and querying data, as well as index types, best‑practice tips, and execution‑plan analysis—providing concrete commands and examples for each step.
This article demonstrates how InnoDB returns rows in primary‑key order during full‑table scans, while queries that use a secondary index follow the leaf‑node order of that index, and it compares performance implications of index‑only scans versus clustered‑index scans.
Adding the right indexes to a complex 12‑table query dramatically cut I/O but unexpectedly increased execution time, and the article explains how an undocumented SQL Server hint forced parallelism to bring the runtime back down.
This article examines three SQL pagination strategies for a 100‑million‑row favorites table, compares their correctness and performance using EXPLAIN analysis, and demonstrates why a GROUP BY approach with proper indexing yields the most reliable and fast results.
This article presents a detailed case study of diagnosing Oracle DBtime spikes using Zabbix, custom scripts, AWR and ASH analysis, revealing how scheduler jobs, materialized view refreshes, parallel execution, and unusable indexes caused performance jitter, and demonstrates step‑by‑step remediation to stabilize DBtime.
This article examines MySQL indexing theory, covering B‑Tree and B+Tree structures, storage‑engine differences between MyISAM and InnoDB, left‑most prefix rules, index selectivity, prefix indexes, and practical optimization techniques for high‑performance query execution.
This article explains MongoDB's three explain modes, details the fields returned by queryPlanner and executionStats, shows how IndexFilters influence the optimizer, and walks through practical examples that demonstrate how proper indexing eliminates collection scans and in‑memory sorts for faster query performance.
MySQL's ORDER BY can either use an ordered index to return rows directly or apply one of two sorting algorithms—original and the MySQL 4.1 enhanced version—to sort data in memory, with the newer method reducing I/O by avoiding a second table read at the cost of higher memory usage.
Using LIMIT OFFSET for pagination becomes inefficient beyond thousands of rows, but by leveraging indexed ID ranges, delayed joins, or index‑only scans you can retrieve pages in milliseconds, dramatically improving performance for large datasets.
This article explains why MySQL ORDER BY may trigger a filesort when no suitable index exists, demonstrates the issue with a product query, and shows how adding a composite index on category_id and price lets the database return rows already sorted, removing the need for an extra sorting step.
This guide shows how to manage MongoDB indexes, covering creation with ensureIndex, listing with getIndexes, checking total index size, reindexing, and removing specific or all indexes using dropIndex and dropIndexes, complete with code snippets and illustrative screenshots.