I have an statistics database for my website visitors and i need to find which is the most efficient way to store the data:
I came across to 2 options.
Option Number 1:
+-----------------------------+
+ date | country +
+-----------------------------+
+ 2014-03-20 | US +
+ 2014-03-20 | US +
+ 2014-03-20 | NL +
+ 2014-03-21 | US +
+-----------------------------+
And then get the visitors data with Select count(*) from table
Option number 2:
+-----------------------------+
+ date | country | visits+
+-----------------------------+
+ 2014-03-20 | US | 2 +
+ 2014-03-20 | NL | 1 +
+ 2014-03-21 | US | 1 +
+-----------------------------+
And then get the visitors data with Select sum(visits) from table
Which do you think is the best option? or is there a better option yet? Please have in mind this in case it has a huge amount of traffic.
Thank you very much in advance.