[BUG] — `meta_data.pathExistedExclude`: cross-namespace path scan + `NOT IN` + unindexed `path`
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
- severity: Medium; files: `mappers/meta-data-sqlmap.xml:154-163`
- description: Unlike `pathExisted` (which filters `path AND namespace_id`), this query has no `namespace_id` filter, so it scans every `meta_data` row whose `path` matches across all namespaces. `path` is unindexed (PERF-A9) → full table scan; `NOT IN` with a list further inhibits index usage. Also a correctness concern: path-uniqueness is supposed to be per-namespace.
- impact: Each call walks the whole `meta_data` table; correctness drift across namespaces.
- suggested_fix: Add `AND namespace_id = #{namespaceId}` and index `(namespace_id, path)`; rewrite `NOT IN` as `NOT EXISTS`.
- confidence: High
---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with mappers/meta-data-sqlmap.xml:154-163 and compare pathExisted with pathExistedExclude, then inspect how meta_data indexes are defined. Verify the query’s namespace and exclusion behavior across multiple namespaces and confirm the index and NOT EXISTS changes with the relevant database tests or checks; done means scoped, efficient path scanning with unchanged intended results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100