Skip to content
Snippets Groups Projects
Commit b1143365 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

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

parent 26fa7c73
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment