I’m wondering what would be a good structure for a Referer Statistics Table. I mean, I got many users. I give them a Referer System and want to show them proper Statistics (for example the monthly / daily amount of clicks and refered users). How would You do this?
Best regards, .wired
Create a table that holds the raw data. Then, create materialized views for the different aggregation levels. If your RDBMS doesn’t support them, create aggregation tables manually.
If performance is not a concern, don’t bother creating aggregation tables. You can use simple views in this case which will save you development effort.