mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #5241] [CLOSED] perf(db): index group_name and client_traffics hot columns #5827
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#5827
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/5241
Author: @n0ctal
Created: 6/12/2026
Status: ❌ Closed
Base:
main← Head:codex-pr-0007-db-hot-path-indexes📝 Commits (1)
499304aperf(db): index group_name and client_traffics hot columns📊 Changes
3 files changed (+44 additions, -3 deletions)
View changed files
➕
internal/database/index_tags_test.go(+41 -0)📝
internal/database/model/model.go(+1 -1)📝
internal/xray/client_traffic.go(+2 -2)📄 Description
Summary
This PR adds the missing hot-path database indexes for:
client_records.group_nameclient_traffics.inbound_idclient_traffics.last_onlineThese columns are used frequently in filtering, grouping, and traffic-related reads, but were not indexed.
Why
On larger datasets, these lookups become unnecessarily expensive and increase query latency for common panel operations.
This change keeps the schema behavior the same while improving read performance on existing and future databases.
Scope
Validation
Risk
Low. This is a schema/index improvement only and does not change application logic.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.