mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-18 19:40:55 +01:00
Improve performance of empty search
Summary: Searching for empty query kills us because whole `search_document` table is read in this case. This diff adds an index just for this query. Other solution would be to disable searching for empty string. But it can be actually useful (listing newest documents of any type). Test Plan: lang=sql EXPLAIN SELECT document.phid, document.documentType, document.documentTitle, document.documentCreated FROM `search_document` document GROUP BY document.phid ORDER BY documentCreated DESC LIMIT 0, 21; Reviewers: epriestley Reviewed By: epriestley CC: jungejason, aran, Koolvin Differential Revision: https://secure.phabricator.com/D2277
This commit is contained in:
parent
bdcba43f21
commit
204b6694af
1 changed files with 2 additions and 0 deletions
2
resources/sql/patches/134.emptysearch.sql
Normal file
2
resources/sql/patches/134.emptysearch.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE `phabricator_search`.`search_document`
|
||||
ADD INDEX `documentCreated` (`documentCreated`);
|
Loading…
Reference in a new issue