Summary

Query runs 4 operators; returns 0 rows in 0.06 ms. No warnings.

Total time
60 µs
Rows returned
0
Rows examined
75
Operators
4

SQL

select testdb.t1.id AS id,testdb.t1.a AS a,testdb.t1.b AS b,testdb.t1.c AS c,testdb.t1.d AS d
from testdb.t1
where ((testdb.t1.b = 100) and (testdb.t1.a = 50))

Execution plan (flamegraph)

Click a plan operator to inspect details.

MySQL Query Plan Reset Zoom Search ic FILTER (((t1.b = 100) and (t1.a = 50))) starts=1 rows=0 (60 µs, 100.00%) Access: filter Rows: 0 actual (1 estimated) Time: 0.060 ms (last row) Cost: 0.62 Condition: ((t1.b = 100) and (t1.a = 50)) FILTER (((t1.b = 100) and (t1.a = 50))) starts=1 rows=0 INDEX RANGE SCAN [t1.idx_a] starts=1 rows=50 (27 µs, 45.00%) Table: testdb.t1 (index: idx_a) Access: index Rows: 50 actual (50 estimated) Time: 0.027 ms (last row) Cost: 0.26 Ranges: (a = 50) Covering: No INDEX RANGE SCAN [t1.idx_a] starts=1 rows=50 INDEX RANGE SCAN [t1.idx_b] starts=1 rows=25 (25 µs, 41.67%) Table: testdb.t1 (index: idx_b) Access: index Rows: 25 actual (25 estimated) Time: 0.025 ms (last row) Cost: 0.26 Ranges: (b = 100) Covering: No INDEX RANGE SCAN [t1.idx_b] starts=1 rows=25 Intersect rows sorted by row ID starts=1 rows=0 (59 µs, 98.33%) Access: rowid_intersection Rows: 0 actual (1 estimated) Time: 0.060 ms (last row) Cost: 0.62 Intersect rows sorted by row ID starts=1 rows=0

myteach — interactive algorithm catalog

Every operator shown above has a hands-on lesson with a cost-model slider and an animated walk-through. The catalog is the central index — bookmark it once, revisit per query:

Open the full catalog →

Raw sidecar (JSON)

{
  "$schema": "https://myflames.dev/schemas/sidecar-v1.json",
  "schema_version": "1.3",
  "generated_at": "2026-04-25T12:51:28Z",
  "myflames_version": "1.5.0",
  "source": {
    "type": "file"
  },
  "plan_summary": {
    "total_time_ms": 0.06,
    "rows_sent": 0,
    "rows_examined_estimate": 75,
    "operator_count": 4,
    "max_depth": 3
  },
  "optimizer_switches": [
    {
      "name": "index_merge",
      "value": "on",
      "explanation": "Uses two or more index range scans on the same table and combines row IDs (union/intersection/sort_union) instead of falling back to a full scan. A composite index is usually faster.",
      "node_labels": [
        "Intersect (row ID)"
      ]
    },
    {
      "name": "index_merge_intersection",
      "value": "on",
      "explanation": "Intersection variant: AND'ed predicates are satisfied by scanning each index and intersecting row IDs — useful when no single composite index covers both predicates.",
      "node_labels": [
        "Intersect (row ID)"
      ]
    }
  ],
  "warnings": [],
  "suggestions": [],
  "executive_summary": "Query runs 4 operators; returns 0 rows in 0.06 ms. No warnings.",
  "plan_tree": {
    "node_id": "n:054c50bb58f3",
    "short_label": "Filter: (((t1.b = 100) and (t1.a = 50)))",
    "folded_label": "FILTER (((t1.b = 100) and (t1.a = 50))) starts=1 rows=0",
    "children": [
      {
        "node_id": "n:5975c5392d32",
        "short_label": "Intersect (row ID)",
        "folded_label": "Intersect rows sorted by row ID starts=1 rows=0",
        "children": [
          {
            "node_id": "n:9e2dede1c469",
            "short_label": "Index range scan [t1.idx_b]",
            "folded_label": "INDEX RANGE SCAN [t1.idx_b] starts=1 rows=25",
            "children": []
          },
          {
            "node_id": "n:b47b84170ee2",
            "short_label": "Index range scan [t1.idx_a]",
            "folded_label": "INDEX RANGE SCAN [t1.idx_a] starts=1 rows=50",
            "children": []
          }
        ]
      }
    ]
  },
  "query": {
    "raw": "/* select#1 */ select `testdb`.`t1`.`id` AS `id`,`testdb`.`t1`.`a` AS `a`,`testdb`.`t1`.`b` AS `b`,`testdb`.`t1`.`c` AS `c`,`testdb`.`t1`.`d` AS `d` from `testdb`.`t1` where ((`testdb`.`t1`.`b` = 100) and (`testdb`.`t1`.`a` = 50))",
    "beautified": "select testdb.t1.id AS id,testdb.t1.a AS a,testdb.t1.b AS b,testdb.t1.c AS c,testdb.t1.d AS d\nfrom testdb.t1\nwhere ((testdb.t1.b = 100) and (testdb.t1.a = 50))"
  },
  "teach_hooks": [
    {
      "lesson": "filter",
      "match": {
        "folded_label": "FILTER (((t1.b = 100) and (t1.a = 50))) starts=1 rows=0",
        "short_label": "Filter: (((t1.b = 100) and (t1.a = 50)))"
      },
      "controls": {
        "input_rows": 1,
        "selectivity": 0.1
      },
      "note": "Filter: ((t1.b = 100) and (t1.a = 50))",
      "query_sql": "/* select#1 */ select `testdb`.`t1`.`id` AS `id`,`testdb`.`t1`.`a` AS `a`,`testdb`.`t1`.`b` AS `b`,`testdb`.`t1`.`c` AS `c`,`testdb`.`t1`.`d` AS `d` from `testdb`.`t1` where ((`testdb`.`t1`.`b` = 100) and (`testdb`.`t1`.`a` = 50))"
    },
    {
      "lesson": "non_unique_lookup",
      "match": {
        "folded_label": "INDEX RANGE SCAN [t1.idx_b] starts=1 rows=25",
        "short_label": "Index range scan [t1.idx_b]"
      },
      "controls": {
        "rows": 25,
        "selectivity": 40.0,
        "covering": false
      },
      "note": "Index range scan on t1 using idx_b over (b = 100) (t1)",
      "query_sql": "/* select#1 */ select `testdb`.`t1`.`id` AS `id`,`testdb`.`t1`.`a` AS `a`,`testdb`.`t1`.`b` AS `b`,`testdb`.`t1`.`c` AS `c`,`testdb`.`t1`.`d` AS `d` from `testdb`.`t1` where ((`testdb`.`t1`.`b` = 100) and (`testdb`.`t1`.`a` = 50))"
    },
    {
      "lesson": "non_unique_lookup",
      "match": {
        "folded_label": "INDEX RANGE SCAN [t1.idx_a] starts=1 rows=50",
        "short_label": "Index range scan [t1.idx_a]"
      },
      "controls": {
        "rows": 50,
        "selectivity": 40.0,
        "covering": false
      },
      "note": "Index range scan on t1 using idx_a over (a = 50) (t1)",
      "query_sql": "/* select#1 */ select `testdb`.`t1`.`id` AS `id`,`testdb`.`t1`.`a` AS `a`,`testdb`.`t1`.`b` AS `b`,`testdb`.`t1`.`c` AS `c`,`testdb`.`t1`.`d` AS `d` from `testdb`.`t1` where ((`testdb`.`t1`.`b` = 100) and (`testdb`.`t1`.`a` = 50))"
    }
  ],
  "operator_complexities": [
    {
      "node_id": "n:5975c5392d32",
      "folded_label": "Intersect rows sorted by row ID starts=1 rows=0",
      "short_label": "Intersect (row ID)",
      "complexity": {
        "big_o": "O(Σ kᵢ)",
        "short": "Σ kᵢ",
        "severity": "medium",
        "rationale": "Index merge (intersection): scans each index separately and intersects the sorted row-ID streams.",
        "confidence": "typical",
        "learn_more": "index_merge"
      }
    },
    {
      "node_id": "n:9e2dede1c469",
      "folded_label": "INDEX RANGE SCAN [t1.idx_b] starts=1 rows=25",
      "short_label": "Index range scan [t1.idx_b]",
      "complexity": {
        "big_o": "O(log n + k)",
        "short": "log n + k",
        "severity": "good",
        "rationale": "Index range scan: one B+tree descent to the range start, then a sequential walk over k matching index entries.",
        "confidence": "exact",
        "learn_more": "index_range_scan"
      }
    },
    {
      "node_id": "n:b47b84170ee2",
      "folded_label": "INDEX RANGE SCAN [t1.idx_a] starts=1 rows=50",
      "short_label": "Index range scan [t1.idx_a]",
      "complexity": {
        "big_o": "O(log n + k)",
        "short": "log n + k",
        "severity": "good",
        "rationale": "Index range scan: one B+tree descent to the range start, then a sequential walk over k matching index entries.",
        "confidence": "exact",
        "learn_more": "index_range_scan"
      }
    }
  ]
}

Teach: Operator deep dive