This is your standard counterCache implementation, Thread belongs to SubForum, the thread_count field in the SubForum model will automatically update every time a new thread is posted.

Now say wanted to add a second field to the SubForum model, a field to count the total threads with certain conditions, for example you want one counterCache field to count the total threads and a second to count the total threads & replies (total posts) to each of those threads.

Here we've said that the Thread has multiple relations to the SubForum, defining the second relation as SubForum2. The counterCache field in the second relation, instead of simply being set to true can be set to the column name you want to update.