Geo performance optimization for a Model to check if it is verifiable
From gitlab-com/gl-infra/production#7756 (comment 1105910027):
But the bug is that this should work if Geo is enabled on GitLab.com scale. If I remember correctly, I thought this query would generally be efficient. But IIUC this is happening because object storage is enabled but there are a few rare local files (perhaps because they failed to migrate to object storage, or because background upload is being used or something like that). We could optimize this by "duplicating" the logic for "what is verifiable" so that the model can perform this check without hitting the DB at all. I think that's how we had it originally. The only downside is then we need to keep that logic in-sync for all models. I'll open an issue to discuss this.