diff options
author | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2010-02-20 11:06:12 +0000 |
---|---|---|
committer | cweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2010-02-20 11:06:12 +0000 |
commit | fe522e57197133d3a4a09425bf2067418a6f3c7c (patch) | |
tree | ea9d7171628b989932ade790a6a7fcc741066a39 /data/templates | |
parent | 05c23695077062ea6948b7c5603848e941c6e9df (diff) | |
download | semanticscuttle-fe522e57197133d3a4a09425bf2067418a6f3c7c.tar.gz semanticscuttle-fe522e57197133d3a4a09425bf2067418a6f3c7c.tar.bz2 |
first sql optimization: fetch countOthers() for all bookmarks at once instead of each single
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@661 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'data/templates')
-rw-r--r-- | data/templates/bookmarks.tpl.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/data/templates/bookmarks.tpl.php b/data/templates/bookmarks.tpl.php index 0050ec8..b1a6eb0 100644 --- a/data/templates/bookmarks.tpl.php +++ b/data/templates/bookmarks.tpl.php @@ -216,7 +216,13 @@ if($currenttag!= '') { <ol <?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks"> - <?php + <?php + $addresses = array(); + foreach ($bookmarks as $key => &$row) { + $addresses[$row['bId']] = $row['bAddress']; + } + $otherCounts = $bookmarkservice->countOthers($addresses); + foreach ($bookmarks as $key => &$row) { switch ($row['bStatus']) { case 0: @@ -261,7 +267,7 @@ if($currenttag!= '') { // Udders! if (!isset($hash)) { - $others = $bookmarkservice->countOthers($row['bAddress']); + $others = $otherCounts[$row['bAddress']]; $ostart = '<a href="'. createURL('history', $row['bHash']) .'">'; $oend = '</a>'; switch ($others) { |