Remove massive "rule applied" query
Summary: Herald rules may be marked as "one-time". We track this by writing a row with <ruleID, phid> when we apply a rule. However, the current test for rule application involves loading every <ruleID, *> pair. We also always write this row even for rules which are not one-time, so if there are 100 rules, we'll load 1,000,000 rows after processing 10,000 objects. Instead, load only the <phid, *> pairs, which are guaranteed to be bounded to at most the number of rules. I'll follow up with a diff that causes us to write rows only for one-time rules, and deletes all historic rows which are not associated with one-time rules. Test Plan: Grepped for callsites to loadAllByContentTypeWithFullData(). Ran rules in test console. Reviewers: nh, btrahan, jungejason Reviewed By: nh CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D1483
This commit is contained in:
2
resources/sql/patches/101.heraldruleapplied.sql
Normal file
2
resources/sql/patches/101.heraldruleapplied.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE phabricator_herald.herald_ruleapplied
|
||||
ADD KEY (phid);
|
||||
Reference in New Issue
Block a user