How helped me optimize Google Spanner DB

Travis Logan
2 min readJan 30


Coming from a MS SQL Server background, I became pretty accustomed to having it’s query tuning advisor available via the enterprise edition. But with our Reimagined platform we have moved to entirely distributed databases and amongst them we have adobted Google Spanner.

I’ve been very impressed with the level of detail I can dive into easily with their insights. I can quickly find, over any timespan, what queries cost me the most. I can view the query plan and it’s happy to show me the bottlenecks. But the help ends there.

I do understand the concepts around indexes, but for some advanced queries that we have I was finding that the indexes I was making just weren’t providing the results I needed or that they weren’t being used at all by the query plan.

I decided to google to see if there were any online services that I could load my schema’s too and provide troublesome queries that would in return suggest indexes. Enter

Within about 2 minutes, I had a set of indexes for a specific advanced query that optimized it by about 8x. This was more than double the optimization that I could achieve on my own after about an hour of effort.

While EverSQL doesn’t have direct support for Spanner quite yet, I used their “other” platform option which gave me these results. They told me they are actively working on their native spanner support though and I look forward to fully using it as our new platform onboards more customers.