A multi-day test run with Spanner has shown an massively increasing CPU usage with growing table size. I'm trying to figure out what could be the reason. Summary of the usage:
- Small size rows (400 byte per row)
- Average around 500 reads (with 0 result) and 500 inserts per second
- Running on 4 nodes
- Growing data size (only inserts, no updates at the moment)
- Composite primary key {a, b, c}
- Reads by secondary index {a, b} (with 0 result)
How can I debug this?
Spanner nicely shows execution plans for manual SQL queries in the console.
The client is in Golang, is there a way to print the actual SQL on client side to execute it manually? Or can I somewhere see the latest executed queries in the spanner console? So far I couldn't find a way to find out what's going on.
What could be causing this CPU increase? It seems to me that there is some processing of the whole table, such as a table scan. I can hardly imagine that reading or updating the secondary index creates this increase.
I appreciate any ideas and hints.