Skip to content

Conversation

domino14
Copy link
Collaborator

@domino14 domino14 commented Aug 4, 2025

this should be part 1 of a many-part games table refactor.

The most pressing problem with our games table right now is the inefficiency of the table. We want to start fixing stuff by partitioning games into monthly tables. This will make queries better/faster. It'll also let us make more incremental/smaller/faster backups.

We can later offload partitions to S3 or similar.

Things that must be tested prior to deploy:

  • migration (auto and manual for old games)
  • annotated games
  • abort/adjudicate (manual and auto)
  • recentgames (for tourneys/clubs and regular profile)
  • streakinfo

@domino14 domino14 marked this pull request as draft August 4, 2025 03:31
@domino14 domino14 force-pushed the partitioned-games branch from 468d139 to 665604c Compare August 4, 2025 03:42
@domino14 domino14 force-pushed the partitioned-games branch 2 times, most recently from 7d68c46 to 006d6d0 Compare August 27, 2025 02:24
- Updated SQL queries in puzzles.sql.go to use past_games table instead of games, adjusting conditions and parameters accordingly.
- Changed return types in GetPotentialPuzzleGames and GetPotentialPuzzleGamesAvoidBots functions from pgtype.Text to string for better compatibility.
- Modified DBStore methods to handle new parameters and return types, ensuring backward compatibility with pgtype.Text.
- Renamed migration tool file from migrate_historical_games.go to main.go for clarity.
- Introduced utility functions for parsing and marshaling GameRequest in the migration tool to support both proto and protojson formats.
- Enhanced game migration logic to extract and store player rating data and original request ID from quickdata.
- Cleaned up sqlc.yaml by removing unnecessary GameRequest type mappings.
@domino14
Copy link
Collaborator Author

domino14 commented Sep 9, 2025

this PR became too big. In accordance with good principles / Mikado method / and so forth, we're going to split this up into small, independent, working deployable units of work.

@domino14 domino14 changed the title progress on rewriting game store [obsolete, but using as a reference] progress on rewriting game store Sep 9, 2025
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