We can use a segment tree to get log sum operations. We also need update and insert to have new log overhead but this can be done concurrently and have no expense to this commands.
I only learned about segment trees today https://en.wikipedia.org/wiki/Segment_tree