Index: modules/statistics/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v
retrieving revision 1.253
diff -u -p -r1.253 statistics.module
--- modules/statistics/statistics.module	15 Feb 2007 11:40:18 -0000	1.253
+++ modules/statistics/statistics.module	17 Feb 2007 21:59:04 -0000
@@ -277,7 +277,7 @@ function statistics_recent_hits() {
  */
 function statistics_top_pages() {
   $sql = "SELECT COUNT(path) AS hits, path, title, AVG(timer) AS average_time, SUM(timer) AS total_time FROM {accesslog} GROUP BY path, title";
-  $sql_cnt = "SELECT COUNT(DISTINCT(path)) FROM {accesslog}";
+  $sql_cnt = "SELECT COUNT(*) FROM {accesslog} GROUP BY path";
 
   $header = array(
     array('data' => t('Hits'), 'field' => 'hits', 'sort' => 'desc'),
@@ -312,7 +312,7 @@ function statistics_top_visitors() {
   );
 
   $sql = "SELECT COUNT(a.uid) AS hits, a.uid, u.name, a.hostname, SUM(a.timer) AS total, ac.aid FROM {accesslog} a LEFT JOIN {access} ac ON ac.type = 'host' AND LOWER(a.hostname) LIKE (ac.mask) LEFT JOIN {users} u ON a.uid = u.uid GROUP BY a.hostname, a.uid, u.name, ac.aid". tablesort_sql($header);
-  $sql_cnt = "SELECT COUNT(DISTINCT(CONCAT(uid, hostname))) FROM {accesslog}";
+  $sql_cnt = "SELECT COUNT(*) FROM {accesslog} GROUP BY uid, hostname";
   $result = pager_query($sql, 30, 0, $sql_cnt);
 
   $rows = array();
@@ -333,7 +333,7 @@ function statistics_top_visitors() {
  */
 function statistics_top_referrers() {
   $query = "SELECT url, COUNT(url) AS hits, MAX(timestamp) AS last FROM {accesslog} WHERE url NOT LIKE '%%%s%%' AND url <> '' GROUP BY url";
-  $query_cnt = "SELECT COUNT(DISTINCT(url)) FROM {accesslog} WHERE url <> '' AND url NOT LIKE '%%%s%%'";
+  $query_cnt = "SELECT COUNT(*) FROM {accesslog} WHERE url <> '' AND url NOT LIKE '%%%s%%' GROUP BY url";
   drupal_set_title(t('Top referrers in the past %interval', array('%interval' => format_interval(variable_get('statistics_flush_accesslog_timer', 259200)))));
 
   $header = array(
