Page MenuHomePhabricator

Improve Conduit performance for custom fields
ClosedPublic

Authored by epriestley on Jul 31 2016, 3:46 PM.
Tags
None
Referenced Files
F13197171: D16351.id39328.diff
Sun, May 12, 11:52 PM
F13196844: D16351.diff
Sun, May 12, 11:36 PM
F13191843: D16351.id39321.diff
Sun, May 12, 1:14 AM
F13181810: D16351.id39322.diff
Thu, May 9, 3:58 PM
Unknown Object (File)
Fri, May 3, 7:26 AM
Unknown Object (File)
Thu, May 2, 4:58 PM
Unknown Object (File)
Mon, Apr 29, 5:50 AM
Unknown Object (File)
Sun, Apr 28, 5:25 AM
Subscribers
None

Details

Summary

Ref T11404. Depends on D16350.

Currently, custom fields can issue "N+1" queries in some cases, so querying 100 revisions issues 100 extra queries.

This affects all *.search endpoints for objects with custom fields, and some older endpoints (notably differential.query).

This change bulk loads "normal" custom fields, which gets rid of some of these queries. Instead of loading fields for each object, we build a big list of all fields and load them all at once.

The next change will tackle the remaining inefficient edge queries.

Test Plan
  • Configured a custom field with normal database storage in Differential.
  • Ran differential.query, looking at custom fields in results for correctness.
  • Ran differential.revision.search, looking at custom fields in results for correctness.
  • In both cases, observed queries drop from 3N to 2N (all the "normal" custom field stuff got bulk loaded).

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Improve Conduit performance for custom fields.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: chad, yelirekim.
  • Fix some array_mergev() junk I refactored into not working.
chad edited edge metadata.
This revision is now accepted and ready to land.Jul 31 2016, 4:23 PM
This revision was automatically updated to reflect the committed changes.