Hello, I'm wondering what the best practice is for having redundant columns in a MySQL database. I'm wondering this because I have a User table in my database but I also want to be able to display many statistics about each individual user. These stats might include how many times a user has interacted with another model or how many messages they have.
Does it hurt performance to search for all records of a certain object (such as messages) in order to count them? Or is it better to make a redundant column in the user table called total_messages that gets updated every time a message is added/removed? Thanks, this has been confusing me for awhile.