Skip to content

perf(data): drop redundant user_sessions single-column indexes#655

Open
AAEE86 wants to merge 6 commits into
fawney19:mainfrom
AAEE86:main
Open

perf(data): drop redundant user_sessions single-column indexes#655
AAEE86 wants to merge 6 commits into
fawney19:mainfrom
AAEE86:main

Conversation

@AAEE86

@AAEE86 AAEE86 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Remove ix_user_sessions_user_id and ix_user_sessions_client_device_id on postgres; all current queries are covered by the composite indexes idx_user_sessions_user_active (user_id, revoked_at, expires_at) and idx_user_sessions_user_device (user_id, client_device_id), so the single-column indexes only add UPDATE write amplification and risk mis-planning. Sync baseline/bootstrap/driver schemas and add a migration to drop them on existing deployments.

AAEE86 added 6 commits June 30, 2026 17:12
Remove ix_user_sessions_user_id and ix_user_sessions_client_device_id
on postgres; all current queries are covered by the composite indexes
idx_user_sessions_user_active (user_id, revoked_at, expires_at) and
idx_user_sessions_user_device (user_id, client_device_id), so the
single-column indexes only add UPDATE write amplification and risk
mis-planning. Sync baseline/bootstrap/driver schemas and add a
migration to drop them on existing deployments.
… requests

done_hub 架构在查询余额和验证流程中要求 Referer 头指向 /panel/profile,
否则请求会被拒绝。同时优化 query_balance 中的冗余 headers clone。
Add bounded runtime configuration for gateway Tokio workers so low-memory
deployments can tune worker count and stack size without allowing accidental
resource exhaustion.

- add AETHER_GATEWAY_TOKIO_WORKER_THREADS with a 128 worker upper bound
- add AETHER_GATEWAY_TOKIO_WORKER_STACK_SIZE_BYTES with 512 KiB..8 MiB bounds
- add usage runtime stack size env overrides with an 8 MiB cap
- keep default stack size at the existing 8 MiB baseline
- make local Docker release builds use the workspace Cargo release profile
- format done_hub Referer header construction

Validation:
- cargo fmt --all --check
- git diff --check
- cargo test -p aether-usage-runtime usage_background_runtime_stack_size_is_configurable -- --nocapture
- cargo check -p aether-gateway --bin aether-gateway
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant