-
Notifications
You must be signed in to change notification settings - Fork 615
[PERFORMANCE]: Optimize SQLite tag filter SQL/bind generation #1833
Copy link
Copy link
Open
Labels
COULDP3: Nice-to-have features with minimal impact if left out; included if time permitsP3: Nice-to-have features with minimal impact if left out; included if time permitsperformancePerformance related itemsPerformance related items
Milestone
Description
Summary
SQLite JSON tag filtering builds SQL text and random bind parameter names per call. This adds CPU overhead in SQLite deployments.
Evidence (current code)
mcpgateway/utils/sqlalchemy_modifier.py: SQLite branch injson_contains_exprusesuuidfor bind names and buildstext(...)per call.
Impact
- Extra CPU for tag-filtered list endpoints on SQLite.
Proposed fix
- Use deterministic bind naming by position; cache SQL text templates by
len(values)andmatch_any.
Acceptance criteria
- SQLite tag filtering avoids random bind names and reuses cached SQL templates.
- Behavior unchanged for any/all matching.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
COULDP3: Nice-to-have features with minimal impact if left out; included if time permitsP3: Nice-to-have features with minimal impact if left out; included if time permitsperformancePerformance related itemsPerformance related items