perf(labrinth/random_projects_get): speed up through spatial queries according to profiling results (#3762)

This commit is contained in:
Alejandro González
2025-06-10 00:19:58 +02:00
committed by GitHub
parent 858c7e393f
commit a3839461cf
5 changed files with 48 additions and 29 deletions

View File

@@ -519,6 +519,9 @@ impl ProjectStatus {
}
// Project can be displayed in search
// IMPORTANT: if this is changed, make sure to update the `mods_searchable_ids_gist`
// index in the DB to keep random project queries fast (see the
// `20250609134334_spatial-random-project-index.sql` migration)
pub fn is_searchable(&self) -> bool {
matches!(self, ProjectStatus::Approved | ProjectStatus::Archived)
}