Commit b1143365 authored by Dries's avatar Dries

- Patch #28924 by Jeremy: simplified 'group by'-clause to improve performance.

parent 26fa7c73
......@@ -250,7 +250,7 @@ function statistics_recent_hits($type = 'all', $id = 0) {
* Menu callback; presents the "top pages" page.
*/
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 = "SELECT COUNT(path) AS hits, path, title, AVG(timer) AS average_time, SUM(timer) AS total_time FROM {accesslog} GROUP BY path";
$sql_cnt = "SELECT COUNT(DISTINCT(path)) FROM {accesslog}";
$header = array(
......
......@@ -250,7 +250,7 @@ function statistics_recent_hits($type = 'all', $id = 0) {
* Menu callback; presents the "top pages" page.
*/
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 = "SELECT COUNT(path) AS hits, path, title, AVG(timer) AS average_time, SUM(timer) AS total_time FROM {accesslog} GROUP BY path";
$sql_cnt = "SELECT COUNT(DISTINCT(path)) FROM {accesslog}";
$header = array(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment