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:
epriestley
2012-01-24 19:03:30 -08:00
parent 067c7f8a74
commit 3142fe4419
5 changed files with 31 additions and 23 deletions

View File

@@ -0,0 +1,2 @@
ALTER TABLE phabricator_herald.herald_ruleapplied
ADD KEY (phid);