-
-
Notifications
You must be signed in to change notification settings - Fork 136
Open
Labels
backendRequires changes to the (node) backend webserverRequires changes to the (node) backend webserverdev experienceImprovements to the code base that make it easier/better/more enjoyable to contribute to CuttleImprovements to the code base that make it easier/better/more enjoyable to contribute to Cuttleversion-patchAn update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1)An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1)
Description
Feature Summary
We should partition the gamestaterow table on the "gameId" column in the production database. This issue is to create the migration script to execute that change
Detailed Description
The gamestaterow table will quickly grow to be the largest table in the system. It is almost exclusively queried via
const game = await Game.findOne({ id: gameId })
.populate('p0')
.populate('p1')
.populate('gameStates', { sort: 'createdAt ASC' });
which hopefully translates to querying like
select *
from "gamestaterow" g
where "gameId" = :gameId;
As the table grows, this query will slow down. To keep its performance manageable, we should partition the table into multiple tables based on "gameId", which postgres can use to more effieicently query for any given gamestaterow based on its gameId.
See postgres partitions for details on the approach
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
backendRequires changes to the (node) backend webserverRequires changes to the (node) backend webserverdev experienceImprovements to the code base that make it easier/better/more enjoyable to contribute to CuttleImprovements to the code base that make it easier/better/more enjoyable to contribute to Cuttleversion-patchAn update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1)An update that warrants a bumping the project's patch version (e.g. 4.0.0 => 4.0.1)