@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add a missing table key to improve performance of "Recently Completed Tasks" query

Summary:
Fixes T11490. Currently, this query can not use a key and the table size may be quite large.

Adjust the query so it can use a key for both selection and ordering, and add that key.

Test Plan: Ran `EXPLAIN` on the old query in production, then added the key and ran `EXPLAIN` on the new query. Saw key in use, and "rows" examined drop from 29,273 to 15.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11490

Differential Revision: https://secure.phabricator.com/D16423

+5
+2
src/infrastructure/daemon/workers/query/PhabricatorWorkerArchiveTaskQuery.php
··· 104 104 105 105 if ($this->dateCreatedBefore) { 106 106 return qsprintf($conn_r, 'ORDER BY dateCreated DESC, id DESC'); 107 + } else if ($this->dateModifiedSince) { 108 + return qsprintf($conn_r, 'ORDER BY dateModified DESC, id DESC'); 107 109 } else { 108 110 return qsprintf($conn_r, 'ORDER BY id DESC'); 109 111 }
+3
src/infrastructure/daemon/workers/storage/PhabricatorWorkerArchiveTask.php
··· 31 31 'leaseOwner' => array( 32 32 'columns' => array('leaseOwner', 'priority', 'id'), 33 33 ), 34 + 'key_modified' => array( 35 + 'columns' => array('dateModified'), 36 + ), 34 37 ) + $parent[self::CONFIG_KEY_SCHEMA]; 35 38 36 39 return $config;