We know for morphisms of schemes $f:X \rightarrow S, u:S’ \rightarrow S, X’=X \times_S S’$, (coherent) sheaf $F$ over X,we have natural morphism $$u^* R^q f_*F\rightarrow R^q u’_* f’^*F$$ where $f’, u’$ are basechanges. (Or using derived category if you like.) The base change theorems says under certain restrictions of the objects and morphisms, it’s isomorphism. Now I’m wondering in more general cases, if there’re some ‘obstruction’ (like certain cohomology groups, spectral sequences) to measure how far it is from isomorphism?

3$\begingroup$ A comment: One reason why base change fails is that the classical fiber product $X\times_S S'$ may forget some information remembered by the derived fiber product. If instead you work with derived schemes you can get more general statements; see the derived algebraic geometry section of en.wikipedia.org/wiki/Base_change_theorems. $\endgroup$– dhyCommented Aug 29, 2021 at 4:18
1 Answer
The composition of functors $Rf_* \colon D(X) \to D(S)$ and $Lu^* \colon D(S) \to D(S')$ is a FourierMukai functor given by an explicit object $K \in D(X \times S')$. It is easy to check that it has no cohomology sheaves in positive degrees, its zero cohomology sheaf is isomorphic to the structure sheaf of the fiber product, but is also may have some cohomology sheaves in negative degrees. The morphism of functors in base change is induced by the natural morphism $$ K \to \mathcal{H}^0(K). $$ Consequently, the cone of the morphism in base change is controlled by the FourierMukai functor with kernel $\tau_{\le 1}(K)$. In particular, base change gives an isomorphism if and only $\tau_{\le 1}(K) = 0$ if and only if $K = \mathcal{H}^0(K)$.
By the way, the negative cohomology sheaves of $K$ are responsible for the derived structure of the fiber product. So, this answer is essentially equivalent to the comment of @dhy.