Admin block speed up

Ignas - August 18, 2007 - 09:35
Project:Admin block
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:minor
Assigned:Unassigned
Status:won't fix
Description

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)

#1

yngens - August 29, 2007 - 06:10
Version:HEAD» 5.x-1.x-dev

I would appreciate if this would be fixed for 5.X version. Currently, admin block loads for more than 100 ms.

#2

frjo - April 22, 2009 - 06:38
Status:active» won't fix

The inner join may take time but I want the node title etc. This only loads for admins so for me it's worth it.

 
 

Drupal is a registered trademark of Dries Buytaert.