Closed (won't fix)
Project:
Admin block
Version:
5.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2007 at 09:35 UTC
Updated:
22 Apr 2009 at 06:38 UTC
Admin block can slow down large site for administrators significally.
Its becouse inefficient SELECTS in adminblock_block. Just get rid off INNER JOIN's.
Comment select will look like
if (user_access('administer comments')) {
$result = db_query_range('SELECT c.timestamp, c.subject, c.cid, c.nid
FROM {comments} c
WHERE c.status = 1
ORDER BY c.timestamp DESC ', 0, $nlimit);
$comment_count = db_num_rows($result);
$comment_count_display = $comment_count > $nlimit ? ' ('. $comment_count .')' : '';
$items = array();
while ($comment = db_fetch_object($result)) {
$rnode = db_fetch_object(db_query_range('SELECT n.title FROM {node} n WHERE n.nid=%d', $comment->nid));
$items[] = check_plain($comment->subject) .' - '. format_date($comment->timestamp, 'medium') .'<br />['. l(t('node'), 'node/'. $comment->nid, array('title' => $rnode->title)) .']|['. l(t('edit'), 'comment/edit/'. $comment->cid) .']|['. l(t('delete'), 'comment/delete/'. $comment->cid) .']';
}
} (in version 4.7)
Its an idea only. I'm not PHP nor DRUPAL guru :) I hope anybody will fix that.
In my large site speed improvement is about 10 times (from 1sec to 0.1sec)
Comments
Comment #1
yngens commentedI would appreciate if this would be fixed for 5.X version. Currently, admin block loads for more than 100 ms.
Comment #2
frjo commentedThe inner join may take time but I want the node title etc. This only loads for admins so for me it's worth it.