{
  "$schema": "https://myflames.dev/schemas/sidecar-v1.json",
  "schema_version": "1.3",
  "generated_at": "2026-04-25T12:51:29Z",
  "myflames_version": "1.5.0",
  "source": {
    "type": "file",
    "engine": "mysql",
    "fixture_path": "/Users/viniciusgrippa/Downloads/git/myflames/test/mysql-explain-skip-scan.json"
  },
  "plan_summary": {
    "total_time_ms": 0.084,
    "rows_sent": 100,
    "rows_examined_estimate": 100,
    "operator_count": 2,
    "max_depth": 2
  },
  "optimizer_switches": [
    {
      "name": "skip_scan",
      "value": "on",
      "explanation": "Uses a composite index even though the query does not filter on the leading column, by probing each distinct leading-column value. Only pays off when the leading column has very low cardinality.",
      "node_labels": [
        "Covering index [ss.g]"
      ]
    },
    {
      "name": "use_index_extensions",
      "value": "on",
      "explanation": "The optimizer treats the primary-key columns appended to every secondary index as additional key parts — enables covering reads that would otherwise need a row fetch.",
      "node_labels": [
        "Covering index [ss.g]"
      ]
    }
  ],
  "warnings": [],
  "suggestions": [],
  "executive_summary": "Query runs 2 operators; returns 100 rows in 0.08 ms. No warnings.",
  "plan_tree": {
    "node_id": "n:73b39ab87252",
    "short_label": "Filter: ((ss.v > 4900))",
    "folded_label": "FILTER ((ss.v > 4900)) starts=1 rows=100",
    "children": [
      {
        "node_id": "n:df672e70bc82",
        "short_label": "Covering index [ss.g]",
        "folded_label": "COVERING INDEX [ss.g] starts=1 rows=100",
        "children": []
      }
    ]
  },
  "query": {
    "raw": "/* select#1 */ select `testdb`.`ss`.`g` AS `g`,`testdb`.`ss`.`v` AS `v` from `testdb`.`ss` where (`testdb`.`ss`.`v` > 4900)",
    "beautified": "select testdb.ss.g AS g,testdb.ss.v AS v\nfrom testdb.ss\nwhere (testdb.ss.v > 4900)"
  },
  "teach_hooks": [
    {
      "lesson": "filter",
      "match": {
        "folded_label": "FILTER ((ss.v > 4900)) starts=1 rows=100",
        "short_label": "Filter: ((ss.v > 4900))"
      },
      "controls": {
        "input_rows": 100,
        "selectivity": 6.0
      },
      "note": "Filter: (ss.v > 4900)",
      "query_sql": "/* select#1 */ select `testdb`.`ss`.`g` AS `g`,`testdb`.`ss`.`v` AS `v` from `testdb`.`ss` where (`testdb`.`ss`.`v` > 4900)"
    },
    {
      "lesson": "skip_scan",
      "match": {
        "folded_label": "COVERING INDEX [ss.g] starts=1 rows=100",
        "short_label": "Covering index [ss.g]"
      },
      "controls": {
        "table_rows": 100,
        "ndv_leading": 5,
        "selectivity": 10
      },
      "note": "Covering index skip scan on ss using g over 4900 < v (ss)",
      "query_sql": "/* select#1 */ select `testdb`.`ss`.`g` AS `g`,`testdb`.`ss`.`v` AS `v` from `testdb`.`ss` where (`testdb`.`ss`.`v` > 4900)"
    }
  ],
  "operator_complexities": [
    {
      "node_id": "n:df672e70bc82",
      "folded_label": "COVERING INDEX [ss.g] starts=1 rows=100",
      "short_label": "Covering index [ss.g]",
      "complexity": {
        "big_o": "O(n)",
        "short": "n",
        "severity": "good",
        "rationale": "Covering index scan: walks the whole index in key order but never touches the clustered tree — all selected columns fit on the index leaves.",
        "confidence": "exact",
        "learn_more": "covering_index"
      }
    }
  ]
}
