codeintel: Optimize nearest upload operations
Created by: efritz
DO NOT MERGE
This branch is to track a particular test candidate for an enterprise customer. If this works, we will land https://github.com/sourcegraph/sourcegraph/pull/16636, have them revert the new migrations and do a regular upgrade from 3.22.