refactor: extract EXPLAIN parsers and AI client from VisualOptimizer
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- リファクタリング
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- mysql, postgresql, react, sqlite, typescript
調査の方向性
Start by reading src/components/results/VisualOptimizer.tsx to trace its EXPLAIN parsing, insight generation, AI calls, and plan tree rendering. Extract the parsers to utils/explainParser.ts, insights to utils/explainInsights.ts, the AI client to src/hooks/useAIExplain.ts, and the recursive tree row as described. Add at least six Vitest tests across the parser and insights modules; done means the component is under about 500 lines and PostgreSQL, MySQL, SQLite, and all four AI providers still work.
索引モデルが issue の本文から書いたものです。
説明
src/components/results/VisualOptimizer.tsx is 1,172 lines. The component parses three different EXPLAIN formats (PostgreSQL, MySQL, SQLite), runs heuristic insight generation, calls four AI providers, and renders the plan tree. Each of those is a clean extraction target.
What to extract
utils/explainParser.ts— one exported function per DB type:parsePostgresPlan(raw),parseMySqlPlan(raw),parseSqlitePlan(raw). All return a normalizedPlanNodetree.utils/explainInsights.ts— the heuristic recommendations (seq-scan warnings, missing-index hints, etc.) as pure functions over the normalizedPlanNode.hooks/useAIExplain.ts— the OpenAI / Anthropic / Google / Ollama fetch with the 30s timeout that already landed in the pre-launch pass. Returns{ run, response, error, loading }.<PlanTreeNode>— the recursive tree row, memoized.
Suggested approach
- Parsers are pure functions — perfect Vitest targets. Aim for at least three test cases per parser (simple, nested, edge-case).
useAIExplaincan sit insrc/hooks/.
Done criteria
VisualOptimizer.tsxdrops below ~500 lines and is mostly rendering glue.- The plan-tree visualization works for at least PostgreSQL EXPLAIN (mysql/sqlite already worked, regressions would be a no-go).
- AI assist still works for all four providers.
- At least 6 Vitest tests across the parser + insights modules.
Out of scope
- Adding new EXPLAIN visualization features.
- Adding new AI providers (separate issue).
Audit reference
K6 in the pre-launch audit.
- 主要言語
- TypeScript
- スター
- 6
- フォーク
- 1
- 平均マージ
- 17分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openidle-dev/queryden のほかの issue
-
Multi Query Clusterオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
openidle-dev/queryden#240 ·
-
bug enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openidle-dev/queryden#187 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
openidle-dev/queryden#237 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
openidle-dev/queryden#192 ·
-
dependencies
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
openidle-dev/queryden#186 ·
openidle-dev/queryden の issue をすべて見る
似ている issue
-
Mend: dependency security vulnerability
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
fdm-monster/fdm-monster#5563 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
growilabs/growi#12246 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
🐛 The Rulekeeper - An index run that gives up on the lock ends Succeeded対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SSWConsulting/SSW.Rules#2809 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信