What is the best database model to store user visits and count unique users using the IP in a big database with 1.000.000 rows for example?
SELECT COUNT(DISTINCT ip) FROM visits
But with 1.000.000 diferent ip's it can be a slow query. Caching will not return the real number.
How big stats systems counts uniques visits?