N+1 queries: counter_cache and the alternative

When counter_cache helps with N+1 queries, when it lies to you, and a cache-free alternative worth knowing.