Actually, there is. There is mapillary (bought by Meta at some point) and KartaView (I don’t think it is that popular). Code is not free, but licence for images is permissive. My personal favorite is Panoramax - completely open source, open licence and even federated!, but it is still in early stages, but keep an eye on it, looks promising. As always, problem with these efforts is not source code, but rather data.
What is your latency? Can you move data closer to where db is (cloud)? Did you change isolation level? Or recovery model? Did you try
bcp
? Any indexes you have in table should be deleted?