General improvement#535
Merged
Merged
Conversation
lenguyenthanh
commented
Apr 1, 2026
Owner
- db: add partial indexes on players for active=true query path
- db: set idle_in_transaction_session_timeout to 30s
- SQL cleanup, add NM/WNM titles, fix IO purity, and expand test coverage
Drop redundant plain-ASC rating indexes (players_standard/rapid/blitz_idx) since Postgres can scan the existing DESC NULLS LAST indexes backwards for ASC queries. Add WHERE active=true partial indexes for all API-facing queries: - players_standard_active_idx - players_rapid_active_idx - players_blitz_active_idx - players_federation_id_active_idx The planner will prefer these smaller, denser indexes over the full players_*_desc_idx variants whenever the query includes active=true, which is the case for all public API endpoints.
A Skunk session that crashes mid-transaction could otherwise hold Postgres locks indefinitely until the pool recycles the connection. 30 s is generous enough for normal bulk-upsert operations while still providing a safety net.
3b47360 to
f312d0f
Compare
- V0019 migration: drop redundant cache_key_idx, replace EXCEPTION-based AVERAGE with CASE WHEN, convert implicit cross-joins to explicit JOINs in federation views, drop 27 redundant indexes on federations_summary, document intentional no-FK on player_history.federation_id - Add NM/WNM to Title enum in both Scala domain and Smithy spec - Wrap OffsetDateTime.now() in IO in Crawler.fetchAndSave - Add 40+ new tests: parser edge cases, syncer status logic, player hash stability, DB sorting/filtering/batch ops, history rating queries, hash-based diffing, and CLI history ingestor integration
f312d0f to
c5b7037
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.