These sources cp-algorithms and geeksforgeeks state that query complexity (for example, submatrix sum) of 2-D segment tree is O(logN * logM), because
it first descends the tree in the first coordinate, and for each traversed vertex of that tree, it makes a query from the usual tree of segments along the second coordinate
However, in all implementations I have met, a query descends the tree along the second coordinate only when it reaches some node of the first tree (cannot recurse any further). Next, since there are no more than 4 recursive calls per level of a segment tree during a query, there would be no more than 4 queries along the second coordinate in total. So, in my view, the rime complexity should be O(logN + logM). What do I miss?