summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-04-28 13:07:05 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-04-28 13:07:05 -0400
commitc7105c2af1ebe3cddd477265c6fea59a61d0c7e5 (patch)
tree51a00bae83d11b8e66d707e3d17d86aeb6b51847 /classes/User.php
parentce5b98ca016841edf920ebc062f1b4d53488762c (diff)
Change to avoid a join in notice inbox
The join in notice_inbox is causing temp-table sorting on identi.ca, so I'm trying a finer-tuned approach.
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php29
1 files changed, 2 insertions, 27 deletions
diff --git a/classes/User.php b/classes/User.php
index 098381f73..ce7ea1464 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -451,34 +451,9 @@ class User extends Memcached_DataObject
} else if ($enabled === true ||
($enabled == 'transitional' && $this->inboxed == 1)) {
- $cache = common_memcache();
+ $ids = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since);
- if (!empty($cache)) {
-
- # Get the notices out of the cache
-
- $notices = $cache->get(common_cache_key($cachekey));
-
- # On a cache hit, return a DB-object-like wrapper
-
- if ($notices !== false) {
- $wrapper = new ArrayWrapper(array_slice($notices, $offset, $limit));
- return $wrapper;
- }
- }
-
- $inbox = Notice_inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since);
-
- $ids = array();
-
- while ($inbox->fetch()) {
- $ids[] = $inbox->notice_id;
- }
-
- $inbox->free();
- unset($inbox);
-
- return Notice::getStreamByIds($ids, 'user:notices_with_friends:' . $this->id);
+ return Notice::getStreamByIds($ids);
}
}