TITLE: Which colimits commute with which limits in the category of sets?
QUESTION [48 upvotes]: Given two categories $I$ and $J$ we say that colimits of shape $I$ commute with limits of shape $J$ in the category of sets, if for any functor $F : I \times J \to \text{Set}$ the canonical map $$\textrm{colim}_{i\in I} \text{lim}_{j\in J} F(i,j) \to \textrm{lim}_{j\in J} \text{colim}_{i\in I} F(i,j)$$ is an isomorphism.
The standard examples are a) filtered colimits commute with finite limits and b) sifted colimits commute with finite products. (Those statements can be regarded as definitions of which categories $I$ are filtered or sifted respectively, but both terms have independent definitions for which these commutation results are propositions.) A third, less known example is to take $I$ a finite group and $J$ a cofiltered category, in other words, if $G$ is a finite group and $X_j$ is an inverse system of $G$-sets, then the canonical map $$(\varprojlim_{j\in J} X_j)/G \to \varprojlim_{j \in J}(X_j/G)$$ is an isomorphism.
Now, all of these examples are easy to prove separately (here's a proof of the $G$-set result, for example) but I see no unifying pattern. Is there a simple criterion for when $I$-colimits and $J$-colimits commute in the category of sets?
[Note: It's true that $I$ is filtered (resp. sifted) if and only if for all finite (resp. finite discrete) $J$ the diagonal functor $I \to I^J$ is final; but I don't think that for arbitrary $I$ and $J$, if the diagonal $I \to I^J$ is final then $I$-colimits commute with $J$-limits. If I'm wrong and that condition on the diagonal actually is sufficient for commutation: why? and is it also necessary?]

REPLY [21 votes]: I'm sorry for having been so slow to react, I was only made aware of this discussion by a colleage of mine recently.. I have been working for several years now on almost exactly all of the above questions in the context of my thesis to be submitted in very near future. 
Concerning first question: That $I$-limits commute with $J$-colimits in set implies that the diagonal functor $J \to J^I$ is final, is a necessary fact wich is only/exactly sufficient when $I$ is a so-called sound class of "limit index", but not in general.
I suggest in my thesis that we define $J$ to be $I$-filtered when the diagonal functor $J \to J^I$ is final instead of when $I$-limits commute with $J$-colimits in set (to keep diagrammatic interpretations).
In fact though sound doctrines are easy to work with they are included in a (nearly just as nice) slightly larger "type of doctrines" (including "pullbacks+terminal objects") namely those classes of index "essentially closed" in the galois correspondence between the classes of "limit index" and classess of "colimit index" that commute in set. I give in my thesis a complete picture of these classes and by this we "decrypt" the abstract conditions of F. Foltz. I'm sorry that I don't yet have nice and short versions of my work to put down here, nor an article ready to refer to, but I'm happy to discuss or answer any related questions in detail either off-line or by email with anyone interested! While finishing written versions.. Cheers, Marie Bjerrum.