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

Commit 00a5a534 authored by Brion Vibber's avatar Brion Vibber

Update sorting for tag-filtered public timeline: needs...

Update sorting for tag-filtered public timeline: needs notice_tag_tag_created_notice_id_idx index added to notice_tag
parent 33daace6
......@@ -55,15 +55,10 @@ class Notice_tag extends Memcached_DataObject
$nt->selectAdd();
$nt->selectAdd('notice_id');
if ($since_id != 0) {
$nt->whereAdd('notice_id > ' . $since_id);
}
if ($max_id != 0) {
$nt->whereAdd('notice_id <= ' . $max_id);
}
Notice::addWhereSinceId($nt, $since_id, 'notice_id');
Notice::addWhereMaxId($nt, $max_id, 'notice_id');
$nt->orderBy('notice_id DESC');
$nt->orderBy('created DESC, notice_id DESC');
if (!is_null($offset)) {
$nt->limit($offset, $limit);
......
-- Add indexes for sorting changes in 0.9.7
-- Allows sorting public timeline by timestamp efficiently
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);
......@@ -307,7 +307,10 @@ create table notice_tag (
constraint primary key (tag, notice_id),
index notice_tag_created_idx (created),
index notice_tag_notice_id_idx (notice_id)
index notice_tag_notice_id_idx (notice_id),
-- For sorting tag-filtered public timeline
index notice_tag_tag_created_notice_id_idx (tag, created, notice_id)
) ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_bin;
/* Synching with foreign services */
......
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