Homec4science

Remove massive "rule applied" query

Authored by epriestley <git@epriestley.com> on Jan 25 2012, 04:03.

Description

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

Details

Committed
epriestley <git@epriestley.com>Jan 25 2012, 04:29
Pushed
aubortJan 31 2017, 17:16
Parents
rPH067c7f8a74d1: Display links to editor in Differential and Diffusion
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH3142fe44197f: Remove massive "rule applied" query (authored by epriestley <git@epriestley.com>).Jan 25 2012, 04:29