We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 3ddfa4de authored by Brion Vibber's avatar Brion Vibber

Update sorting on reply/mentions timeline: added...

Update sorting on reply/mentions timeline: added reply_profile_id_modified_notice_id_idx index to reply table
parent 00a5a534
......@@ -50,15 +50,10 @@ class Reply extends Memcached_DataObject
$reply = new Reply();
$reply->profile_id = $user_id;
if ($since_id != 0) {
$reply->whereAdd('notice_id > ' . $since_id);
}
if ($max_id != 0) {
$reply->whereAdd('notice_id <= ' . $max_id);
}
Notice::addWhereSinceId($reply, $since_id, 'notice_id', 'modified');
Notice::addWhereMaxId($reply, $max_id, 'notice_id', 'modified');
$reply->orderBy('notice_id DESC');
$reply->orderBy('modified DESC, notice_id DESC');
if (!is_null($offset)) {
$reply->limit($offset, $limit);
......
......@@ -5,3 +5,6 @@ alter table notice add index notice_created_id_is_local_idx (created,id,is_local
-- Allows sorting tag-filtered public timeline by timestamp efficiently
alter table notice_tag add index notice_tag_tag_created_notice_id_idx (tag, created, notice_id);
-- Needed for sorting reply/mentions timelines
alter table reply add index reply_profile_id_modified_notice_id_idx (profile_id, modified, notice_id);
......@@ -162,7 +162,10 @@ create table reply (
constraint primary key (notice_id, profile_id),
index reply_notice_id_idx (notice_id),
index reply_profile_id_idx (profile_id),
index reply_replied_id_idx (replied_id)
index reply_replied_id_idx (replied_id),
-- Needed for sorting reply/mentions timelines
index reply_profile_id_modified_notice_id_idx (profile_id, modified, notice_id)
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment