Skip to content

[P1][bug] TYPE_COLORS missing index_merge, fulltext, spatial, ref_or_null — renders gray with no explanation #426

Closed

Description

@EVWorth

Context

ExplainPanel colour-codes EXPLAIN access types via TYPE_COLORS map.

Problem

src/components/explain/ExplainPanel.tsx:18-32 (TYPE_COLORS, TYPE_RANK) — MySQL EXPLAIN type column can be index_merge (intersection/union of multiple indexes — efficiency between range and ref), fulltext (FULLTEXT index access), spatial (spatial index), ref_or_null (ref with NULL handling). Renders as gray because TYPE_COLORS[k] is undefined → getTypeColor returns bg-gray-600/80 text-white (line 32). The legend in the toolbar shows the rank, but the rank is undefined for index_merge → sorted([undefined]) works but visually renders the legend without the type label.

Files

  • src/components/explain/ExplainPanel.tsx:18-32

Repro

  1. EXPLAIN SELECT * FROM t1 USE INDEX(i1) INNER JOIN t2 USE INDEX(i2) — produces type=index_merge
  2. EXPLAIN panel renders the badge as gray, legend doesn't list it

Expected

An index_merge EXPLAIN row shows a yellow badge labelled index_merge. The legend includes all known access types.

Proposed fix

Add index_merge: 'bg-yellow-700/80 text-white', fulltext: 'bg-purple-600/80 text-white', spatial: 'bg-pink-600/80 text-white', ref_or_null: 'bg-green-400/80 text-white' to TYPE_COLORS. Add corresponding entries to TYPE_RANK (or use a parallel ACCESS_TYPES_ORDERED array — see F15). Scope: S.

Acceptance

An index_merge EXPLAIN row shows a yellow badge labelled index_merge. The legend includes all known access types.

Needs human verify

no

Doc drift

no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/explainauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions