Optimize SQL queries in differential.getdiff
Test Plan: Verified that the method retuns the same output. Verified the number of SQL queries. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2764
This commit is contained in:
@@ -70,10 +70,11 @@ final class ConduitAPI_differential_getdiff_Method extends ConduitAPIMethod {
|
||||
throw new ConduitException('ERR_BAD_DIFF');
|
||||
}
|
||||
|
||||
$diff->attachChangesets($diff->loadChangesets());
|
||||
// TODO: We could batch this to improve performance.
|
||||
$diff->attachChangesets(
|
||||
$diff->loadRelatives(new DifferentialChangeset(), 'diffID'));
|
||||
foreach ($diff->getChangesets() as $changeset) {
|
||||
$changeset->attachHunks($changeset->loadHunks());
|
||||
$changeset->attachHunks(
|
||||
$changeset->loadRelatives(new DifferentialHunk(), 'changesetID'));
|
||||
}
|
||||
|
||||
$basic_dict = $diff->getDiffDict();
|
||||
|
||||
Reference in New Issue
Block a user