Let's say we've got 3 entities here, User, Tag, Track and a single associative entity called Tagged.
I need to count a tag frequency of a track and the common way is to count the record of tagged, but what if I just store the tag's frequency as an integer attribute on Tag entity, and maintain the value every time there are changed on Tagged's record, will it be a problem ?
Edit:
The DBMS I'm using is MySQL 5.6.
About the dataset, there are 947 tracks, 7962 tags, 800~ users, and 366617 taggeds
Why I need to query it fast ? Because, I'm trying to calculate similarity value between each track and in that process I need to obtain the frequency of each tag of the tracks I'm calculating and I think the slow query is where it should obtain the frequency from counting the record on Tagged, that's why I think maybe I should just directly store the frequency instead of count through those records.