[BUG] — `namespace_plugin_rel` list queries fetch `plugin_jar` MEDIUMBLOB per row + derived table + OR leading-wildcard LIKE
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
- severity: High; files: `mappers/namespace-plugin-rel-sqlmap.xml:74-112` (`selectByQuery`) and `:160-193` (`searchByCondition`); service `NamespacePluginServiceImpl.java:136` (no `@Pageable`)
- description: `selectByQuery` selects `p.plugin_jar AS pluginJar` (BLOB, `schema.sql:41` mediumblob) per list row; uses a derived table on `namespace_plugin_rel`; `p.name LIKE '%...%'`; no `LIMIT`. `searchByCondition` adds `p.name LIKE '%kw%' OR p.role LIKE '%kw%'` (OR of two leading-wildcard LIKEs). No index on `namespace_plugin_rel(namespace_id, plugin_id, enabled)` or `plugin(name)`.
- impact: List endpoint memory/latency dominated by BLOB transfer and full scans.
- suggested_fix: Drop `plugin_jar` from list column list; add `@Pageable`; add indexes; replace `LIKE '%kw%' OR ...` with a union or full-text.
- confidence: High
---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.md)._
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with selectByQuery and searchByCondition in mappers/namespace-plugin-rel-sqlmap.xml:74-112 and :160-193, then inspect NamespacePluginServiceImpl.java:136 and schema.sql:41. Verify how list results are assembled and how pagination, indexes, and keyword search affect the queries. Done means list queries no longer transfer plugin_jar per row, are bounded, and avoid the reported scan-heavy patterns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- backend-api-design, databases, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100