Still missing the point...
The members table needs to be called no matter what. So if you have a system that just keeps a column inside that table updated for new messages,
you save a global query (or two, because of notices now). From the surface, invision's message system works like this:
1 column in members table for new pm's. 1 column in member's table for message total. 1 column in member_extended or something for folder and some type of folder count or whatever, delimited by special characters and explode()'d upon being called in this mess of code. It's really messy, things are everywhere. My system isn't totally defined yet, but right now I have a column for new pm's simply because of the complexity of the 2nd column that stores folder counts, folder names, and real names, as well as new notices and their types, new pm's in a serialized array. Upon signing on or refreshing the page, the serialized array is unserialized and that's where the fun begins. It's kind of a table inside a table, but you only access it using php.
Folder names need to be stated somewhere in some table anyways, it might as well as keep folder counts and such anyways.
So basically... use a query only when action is being taken instead of using 2+ queries on every page refresh. Using sql num rows would be pointless because there's different types of notices and I want to display it as such, instead, there would have to be a select statement with code to cycle through each row to build counts. Not only that, but there is no real way to tell what notices are new that way unless I make up some read/unread column for notices... yet, the whole point of notices was a quick clean message system where you don't have to necessarily manage it at all.
Bans and all their types will probably work the same way: instead of querying one or more tables to see if a user is banned, it'll be an array like:
if ($vars->member['bans']['forums'][$this_forum_id])
$display->critical("nope nope nope!");
I dunno why I'm explaining it ;/. Check out serialize() on php.net.
PS rexy, I got some more music for you to listen to
.