Changeset 1742


Ignore:
Timestamp:
05/26/10 15:29:44 (3 years ago)
Author:
nick_ramsay
Message:

[Branch 1.3] Reduced the SQL result set for child comments by three columns. Checking the comment tree for each parent comment is quite time consuming so we have to shave off any unnecessary baggage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/libs/Comment.php

    r1738 r1742  
    146146        function readAllChildren($h, $parent) 
    147147        { 
    148                 $sql = "SELECT * FROM " . TABLE_COMMENTS . " WHERE comment_parent = %d AND comment_status = %s ORDER BY comment_date"; 
     148                $fields = "comment_id, comment_post_id, comment_user_id, comment_parent, comment_date, comment_status, comment_content, comment_votes_up, comment_votes_down, comment_subscribe"; 
     149                 
     150                $sql = "SELECT " . $fields . " FROM " . TABLE_COMMENTS . " WHERE comment_parent = %d AND comment_status = %s ORDER BY comment_date"; 
    149151                $query = $h->db->prepare($sql, $parent, 'approved'); 
    150152                 
Note: See TracChangeset for help on using the changeset viewer.