{
  "id": 12182396,
  "title": "How MySQL Implicit Type Conversion Turned an Indexed Query Into a 7M-Row Scan",
  "url": "https://urgent.news/2026/10/05/how-mysql-implicit-type-conversion-turned-an-indexed-query-into-a-7m",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-05T15:49:22.000Z",
  "source": {
    "name": "HackerNoon",
    "slug": "hackernoon",
    "url": "https://hackernoon.com/how-mysql-implicit-type-conversion-turned-an-indexed-query-into-a-7m-row-scan?source=rss"
  },
  "original_language": "en",
  "account": "A seemingly routine database maintenance task turned into a major crisis when a small batch of customer account records required a minor state update. Despite the simplicity of the UPDATE statement, MySQL's implicit type conversion caused the database to scan over seven million rows instead of just the few it needed to modify. This issue arose from a mismatch between the string-based provider_code and an unquoted integer literal in the query's filter condition. The database treated the integer as a double-precision floating-point number and performed an implicit conversion for every row, effectively bypassing the index and triggering a full table scan. To prevent this from happening again, the lesson emphasizes the importance of using quotes when comparing numbers to string columns. However, even after correcting the data types, the database still needed to scan 3.6 million rows due to the composite index's limitations on the date-range filter condition.",
  "summary": "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.",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}