Update sorting for conversation views: adds notice_conversation_created_id_idx index on notice, replacing more limited notice_conversation_idx

This commit is contained in:
Brion Vibber
2010-12-17 16:08:37 -08:00
parent 71151b3bc0
commit fb65d5901d
3 changed files with 13 additions and 14 deletions

View File

@@ -704,19 +704,14 @@ class Notice extends Memcached_DataObject
$notice->conversation = $id;
$notice->orderBy('id DESC');
$notice->orderBy('created DESC, id DESC');
if (!is_null($offset)) {
$notice->limit($offset, $limit);
}
if ($since_id != 0) {
$notice->whereAdd('id > ' . $since_id);
}
if ($max_id != 0) {
$notice->whereAdd('id <= ' . $max_id);
}
Notice::addWhereSinceId($notice, $since_id);
Notice::addWhereMaxId($notice, $max_id);
$ids = array();