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

Commit 66474586 authored by Brion Vibber's avatar Brion Vibber

Update sorting for group inbox timelines; adds...

Update sorting for group inbox timelines; adds group_inbox_group_id_created_notice_id_idx index to group_inbox table
parent 3ddfa4de
......@@ -100,15 +100,10 @@ class User_group extends Memcached_DataObject
if ($since_id != 0) {
$inbox->whereAdd('notice_id > ' . $since_id);
if ($max_id != 0) {
$inbox->whereAdd('notice_id <= ' . $max_id);
Notice::addWhereSinceId($inbox, $since_id, 'notice_id');
Notice::addWhereMaxId($inbox, $max_id, 'notice_id');
$inbox->orderBy('notice_id DESC');
$inbox->orderBy('created DESC, notice_id DESC');
if (!is_null($offset)) {
$inbox->limit($offset, $limit);
......@@ -8,3 +8,6 @@ alter table notice_tag add index notice_tag_tag_created_notice_id_idx (tag, crea
-- Needed for sorting reply/mentions timelines
alter table reply add index reply_profile_id_modified_notice_id_idx (profile_id, modified, notice_id);
-- Needed for sorting group messages by timestamp
alter table group_inbox add index group_inbox_group_id_created_notice_id_idx (group_id, created, notice_id);
......@@ -480,7 +480,10 @@ create table group_inbox (
constraint primary key (group_id, notice_id),
index group_inbox_created_idx (created),
index group_inbox_notice_id_idx (notice_id)
index group_inbox_notice_id_idx (notice_id),
-- Needed for sorting group messages by timestamp
index group_inbox_group_id_created_notice_id_idx (group_id, created, notice_id)
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