# How MySQL Implicit Type Conversion Turned an Indexed Query Into a 7M-Row Scan

DevFeed: [How MySQL Implicit Type Conversion Turned an Indexed Query Into a 7M-Row Scan](<https://devfeed.tech/articles/how-mysql-implicit-type-conversion-turned-an-indexed-query-into-a-7m-row-scan-64959.md>)

Original publisher: [Read original article](<https://hackernoon.com/how-mysql-implicit-type-conversion-turned-an-indexed-query-into-a-7m-row-scan?source=rss>)

Author: Oluwaseun

Published: 2026-10-05T15:49:22Z

Content type: tutorial

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [MySQL](<https://devfeed.tech/topics/mysql.md>), [database-optimization](<https://devfeed.tech/topics/database-optimization.md>), [table-partitioning](<https://devfeed.tech/topics/table-partitioning.md>), [Tech Debt](<https://devfeed.tech/topics/tech-debt.md>)

Tags: [batching](<https://devfeed.tech/tags/batching.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [database-administration](<https://devfeed.tech/tags/database-administration.md>), [database-indexes](<https://devfeed.tech/tags/database-indexes.md>), [implicit-type-conversion](<https://devfeed.tech/tags/implicit-type-conversion.md>), [mvcc](<https://devfeed.tech/tags/mvcc.md>), [mysql](<https://devfeed.tech/tags/mysql.md>), [mysql-data-types](<https://devfeed.tech/tags/mysql-data-types.md>), [optimize-mysql-queries](<https://devfeed.tech/tags/optimize-mysql-queries.md>), [query](<https://devfeed.tech/tags/query.md>), [sql-performance-tuning](<https://devfeed.tech/tags/sql-performance-tuning.md>), [sql-query-optimization](<https://devfeed.tech/tags/sql-query-optimization.md>)

## AI overview

A production UPDATE intended to change a few customer records risked scanning millions of rows because a numeric literal was compared with a VARCHAR column, leading MySQL to apply implicit type conversion and bypass the index. The article describes correcting the literal, accounting for a date filter absent from the composite index, and safely extracting target IDs before updating them in batches with production safeguards.

## Source excerpt

A missing quote made MySQL scan 7.2 million rows. Here's how EXPLAIN exposed the problem and what it taught us about safe production updates.