Tagged articles

Semi-Join

6 articles · Page 1 of 1
dbaplus Community
dbaplus Community
Sep 22, 2022 · Databases

Why MySQL IN Subqueries Turn Into Slow Full Scans—and How to Fix Them

A large‑scale user‑push system suffers from minutes‑long MySQL queries because the IN subquery materializes a temporary table and triggers a semi‑join that forces full table scans, but disabling the semi‑join optimizer or rewriting the query restores sub‑second performance.

MySQLSQL OptimizationSemi-Join
0 likes · 8 min read
Why MySQL IN Subqueries Turn Into Slow Full Scans—and How to Fix Them
Java High-Performance Architecture
Java High-Performance Architecture
Aug 2, 2022 · Databases

Why MySQL IN Subqueries Can Be So Slow and How to Fix Them

This article examines why a MySQL query that uses an IN subquery on a massive users table becomes extremely slow, analyzes the execution plan revealing materialized temporary tables and semi‑join optimization, and demonstrates how disabling the optimizer or rewriting the query restores index usage and dramatically improves performance.

IndexingMySQLQuery Optimization
0 likes · 8 min read
Why MySQL IN Subqueries Can Be So Slow and How to Fix Them
Architecture Digest
Architecture Digest
Jul 18, 2022 · Databases

Why MySQL IN Subquery with Semi‑Join Is Slow and How to Optimize It

The article analyzes a slow MySQL query that uses an IN subquery on a massive user table, explains how the optimizer’s semi‑join and materialized temporary tables cause full‑table scans, and demonstrates practical fixes such as disabling the semi‑join optimizer switch or rewriting the SQL to regain index usage.

IndexMySQLSQL Optimization
0 likes · 8 min read
Why MySQL IN Subquery with Semi‑Join Is Slow and How to Optimize It