SELECT 
  category_id 
FROM 
  q_categories 
WHERE 
  id_path LIKE '12/%'

Query time 0.00069

JSON explain

{
  "query_block": {
    "select_id": 1,
    "cost_info": {
      "query_cost": "118.61"
    },
    "table": {
      "table_name": "q_categories",
      "access_type": "range",
      "possible_keys": [
        "id_path"
      ],
      "key": "id_path",
      "used_key_parts": [
        "id_path"
      ],
      "key_length": "767",
      "rows_examined_per_scan": 84,
      "rows_produced_per_join": 84,
      "filtered": "100.00",
      "index_condition": "(`portal`.`q_categories`.`id_path` like '12/%')",
      "cost_info": {
        "read_cost": "101.81",
        "eval_cost": "16.80",
        "prefix_cost": "118.61",
        "data_read_per_join": "221K"
      },
      "used_columns": [
        "category_id",
        "id_path"
      ]
    }
  }
}

Result

category_id
13
14
16
17
18
19
20
21
22
23
24
25
26
27
608
609
28
36
15
29
30
31
32
33
34
35
37
38
40
41
42
43
83
44
45
46
293
294
295
296
297
298
47
48
49
600
50
51
52
53
54
55
56
57
58
59
60
613
66
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
84
205
601
85
87
88
89
90
555
564
582
604
605
607
91
92
93
94
99
95
597
96
97
98