Today I found this lovely lattice of every possible "clone" of Boolean functions. A clone is a set closed under projection and composition, so you can think of each entry as the set of circuits constructible using particular logic gates.
But, there's more! This is from "The Complexity of Satisfiability Problems: Refining Schaefer’s Theorem" (https://www.sciencedirect.com/science/article/pii/S0022000008001141) The colored nodes are the sets of functions that can be polymorphisms of a set of relations. They are the invariants or closures of those relations -- pick N tuples from the relation, apply the N-ary function elementwise, and out pops a new element of the relation.
Knowing the set of polymorphisms for a set of relations R tells you the complexity class of the decision problem for conjuctive clauses built out of R. For example, we can pick relations that correspond to 3SAT, but they have only the identity polymorphisms, so the decision problem is in NP. This provides more structure within P (under AC0-reductions) than the older Shaefer's Dichotomy Theorem.
Now, I don't really understand the proof yet. In fact, I don't even understand why these classes are the only ones that can be polymorphisms of binary relations. I think I should be able to prove that some of them could not be, but the paper just breezily states "It is immediate from a look at Figure 1 that this covers all cases." The lattice structure itself was discovered by Emil Post.