Tag

limit

0 views collected around this technical thread.

Java Tech Enthusiast
Java Tech Enthusiast
Mar 23, 2025 · Databases

MySQL Query Optimization Techniques: LIMIT, Implicit Conversion, Joins and More

The article shows how common MySQL performance pitfalls—such as large LIMIT offsets, implicit type conversions, sub‑query‑based updates or deletes, mixed ORDER BY, EXISTS clauses, and misplaced predicates—can be rewritten into index‑friendly forms using filters, joins, early limits, UNION ALL, and CTEs to achieve execution times that drop from seconds to milliseconds.

IndexesMySQLSQL Optimization
0 likes · 14 min read
MySQL Query Optimization Techniques: LIMIT, Implicit Conversion, Joins and More
Architecture Digest
Architecture Digest
Nov 9, 2024 · Databases

MySQL Query Optimization Techniques and Common Pitfalls

This article examines frequent MySQL performance problems such as inefficient LIMIT pagination, implicit type conversion, sub‑query updates, mixed sorting, misuse of EXISTS, condition push‑down limitations, early result narrowing, intermediate result push‑down, and demonstrates how rewriting queries with JOINs, derived tables, and WITH clauses can dramatically improve execution speed.

IndexMySQLPerformance
0 likes · 11 min read
MySQL Query Optimization Techniques and Common Pitfalls
Top Architect
Top Architect
Apr 19, 2024 · Databases

Problems with OFFSET/LIMIT Pagination and Cursor‑Based Alternatives

This article explains why using OFFSET and LIMIT for pagination becomes inefficient on large tables, illustrates the performance impact with examples, and proposes a cursor‑based pagination alternative that leverages indexed primary keys to achieve faster, scalable queries.

CursorDatabasePerformance
0 likes · 8 min read
Problems with OFFSET/LIMIT Pagination and Cursor‑Based Alternatives
Architecture Digest
Architecture Digest
Mar 31, 2024 · Databases

Why OFFSET/LIMIT Pagination Fails at Scale and How to Use Cursor‑Based Pagination

This article explains how OFFSET and LIMIT cause severe performance problems on large tables due to full‑table scans, demonstrates the issue with real‑world examples, and presents a more efficient cursor‑based (keyset) pagination technique as a practical alternative.

CursorDatabasePerformance
0 likes · 6 min read
Why OFFSET/LIMIT Pagination Fails at Scale and How to Use Cursor‑Based Pagination
Architect's Guide
Architect's Guide
Feb 18, 2024 · Databases

Problems with OFFSET and LIMIT and Alternative High‑Performance Pagination Strategies

This article explains why using OFFSET and LIMIT for pagination on large tables leads to costly full‑table scans and poor performance, and introduces keyset (cursor) pagination as a faster, index‑driven alternative while discussing its requirements and trade‑offs.

CursorDatabasePerformance
0 likes · 5 min read
Problems with OFFSET and LIMIT and Alternative High‑Performance Pagination Strategies
JD Retail Technology
JD Retail Technology
Oct 20, 2023 · Databases

Understanding Pagination Issues with ORDER BY and LIMIT in MySQL

This article examines why combining ORDER BY with LIMIT in MySQL pagination can produce duplicate rows on subsequent pages, analyzes the optimizer’s priority‑queue behavior introduced in version 5.6, and presents practical solutions such as using unique sort keys, adding ID ordering, and understanding deep‑pagination limitations.

DatabaseMySQLORDER BY
0 likes · 8 min read
Understanding Pagination Issues with ORDER BY and LIMIT in MySQL
JD Retail Technology
JD Retail Technology
Sep 13, 2023 · Databases

Optimizing Pagination Queries for Billion‑Row MySQL Tables

The article analyzes the performance problems of deep pagination on massive MySQL tables storing billions of fan records and presents three progressive solutions—simple LIMIT, tag‑record (maxId) pagination, and range‑limited pagination with async and offline minId caching—along with general indexing best‑practices for high‑throughput queries.

IndexingMySQLQuery Optimization
0 likes · 10 min read
Optimizing Pagination Queries for Billion‑Row MySQL Tables
Laravel Tech Community
Laravel Tech Community
May 22, 2023 · Databases

Why OFFSET/LIMIT Pagination Is Inefficient and How to Use Cursor‑Based Pagination

The article explains the performance drawbacks of using OFFSET and LIMIT for pagination on large tables, illustrates the issue with full‑table scans, and presents a more efficient cursor‑based approach that leverages indexed primary keys to retrieve pages quickly.

CursorDatabasePerformance
0 likes · 5 min read
Why OFFSET/LIMIT Pagination Is Inefficient and How to Use Cursor‑Based Pagination
Laravel Tech Community
Laravel Tech Community
May 14, 2023 · Databases

Using LIMIT with DELETE: Benefits and Best Practices in MySQL

The article explains why adding a LIMIT clause to MySQL DELETE statements is a recommended habit, detailing performance gains, reduced locking, safer error handling, and practical execution strategies for large‑scale deletions.

DELETEMySQLPerformance
0 likes · 6 min read
Using LIMIT with DELETE: Benefits and Best Practices in MySQL
Architecture Digest
Architecture Digest
Feb 22, 2023 · Databases

Understanding the Execution Order of SQL Queries

This article explains the logical execution sequence of a typical SQL query, detailing each phase from FROM/JOIN/WHERE through GROUP BY, HAVING, SELECT, ORDER BY, and LIMIT, and illustrating the process with diagrams and code examples.

DatabaseFrom Join WhereGROUP BY
0 likes · 8 min read
Understanding the Execution Order of SQL Queries
Java Architect Essentials
Java Architect Essentials
Feb 19, 2023 · Databases

Understanding the Execution Order of SQL Queries

This article explains the step‑by‑step execution order of a standard SQL query, covering FROM/JOIN, WHERE, GROUP BY, HAVING, SELECT, DISTINCT, ORDER BY and LIMIT, and provides illustrative code snippets and diagrams to clarify each stage.

FROMGROUP BYHAVING
0 likes · 5 min read
Understanding the Execution Order of SQL Queries
Laravel Tech Community
Laravel Tech Community
Jan 2, 2023 · Databases

Advanced MySQL Query Optimization Techniques: LIMIT, Implicit Conversion, Join Rewrite, and More

This article presents a series of practical MySQL performance‑tuning methods—including smarter LIMIT usage, handling implicit type conversion, rewriting UPDATE/DELETE with JOIN, mixed‑order optimization, EXISTS replacement, condition push‑down, early result filtering, and CTE usage—to dramatically reduce query execution time across common scenarios.

IndexesMySQLSQL Optimization
0 likes · 13 min read
Advanced MySQL Query Optimization Techniques: LIMIT, Implicit Conversion, Join Rewrite, and More
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Apr 28, 2022 · Databases

Maximum Number of Tables in MySQL (InnoDB) – Up to 4 Billion Tables

A recent poll revealed that MySQL with the InnoDB engine can support up to four billion tables, a limit dictated by the underlying file system rather than MySQL itself, and the official documentation confirms this massive capacity.

File SystemInnoDBMySQL
0 likes · 2 min read
Maximum Number of Tables in MySQL (InnoDB) – Up to 4 Billion Tables
Selected Java Interview Questions
Selected Java Interview Questions
Mar 19, 2022 · Databases

Why LIMIT OFFSET with Large Offsets Is Slow in MySQL and How to Optimize It

Using a large OFFSET in MySQL's LIMIT clause forces the server to scan hundreds of thousands of index and data pages, causing excessive random I/O, whereas rewriting the query with a sub‑select and join reduces page accesses dramatically, as demonstrated through buffer‑pool measurements.

IndexMySQLPerformance
0 likes · 8 min read
Why LIMIT OFFSET with Large Offsets Is Slow in MySQL and How to Optimize It
Top Architect
Top Architect
Mar 5, 2022 · Databases

Why MySQL LIMIT with Large Offsets Is Slow and How to Optimize It

The article demonstrates that MySQL queries using LIMIT with a large offset cause heavy random I/O by scanning many rows, and shows how rewriting the query with a sub‑query that selects only primary keys dramatically reduces execution time from seconds to milliseconds.

MySQLPerformanceQuery Optimization
0 likes · 8 min read
Why MySQL LIMIT with Large Offsets Is Slow and How to Optimize It
Laravel Tech Community
Laravel Tech Community
Feb 14, 2022 · Databases

Why LIMIT with ORDER BY Can Produce Duplicate Pages in MySQL and How to Resolve It

The article explains why using LIMIT together with ORDER BY in MySQL 5.6 can cause duplicate records on subsequent pages, analyzes the priority‑queue optimization that makes the sort unstable, and offers practical solutions such as indexing, proper pagination logic, and query adjustments.

MySQLORDER BYPriority Queue
0 likes · 8 min read
Why LIMIT with ORDER BY Can Produce Duplicate Pages in MySQL and How to Resolve It
Architect's Tech Stack
Architect's Tech Stack
Feb 14, 2022 · Databases

Optimizing Existence Checks: Replace COUNT(*) with SELECT 1 LIMIT 1

The article explains why using COUNT(*) to test for record existence is inefficient and demonstrates how replacing it with SELECT 1 … LIMIT 1 in SQL and a corresponding Java existence check can significantly improve database query performance.

DatabaseOptimizationPerformance
0 likes · 3 min read
Optimizing Existence Checks: Replace COUNT(*) with SELECT 1 LIMIT 1