[drupal-devel] [task] db_num_rows(db_query()) inefficiency

Thomas Ilsche drupal-devel at drupal.org
Wed Aug 10 18:16:33 UTC 2005


Issue status update for 
http://drupal.org/node/28631
Post a follow up: 
http://drupal.org/project/comments/add/28631

 Project:      Drupal
 Version:      4.6.0
 Component:    search.module
 Category:     tasks
 Priority:     minor
 Assigned to:  Anonymous
 Reported by:  Thomas Ilsche
 Updated by:   Thomas Ilsche
 Status:       patch (code needs review)
 Attachment:   http://drupal.org/files/issues/search.module.patch.txt (848 bytes)

search.module uses


$count = db_num_rows(db_query("SELECT DISTINCT i.sid, i.type FROM
{search_index} i $join WHERE $conditions", $arguments));


I think using COUNT(i.sid) should provide an increase in effiecency.


Waiting for comments.


BTW there are 5 more occurances of "db_num_rows(db_query(" is there any
reason for that?




Thomas Ilsche




More information about the drupal-devel mailing list