phorge/src
epriestley 4adaf53bf0 Dramatically increase cache hit rate for feed
Summary:
Ref T8631. The query plan for feed stories is really bad right now, because we miss caches we should be hitting:

  - The workspace cache is stored at each query, so adjacent queries can't benefit from the cache (only subqueries). Feed has primarily sibling queries.
    - There is no technical reason to do this. Store the workspace cache on the root query, so sibling queries can hit it.
  - In `ObjectQuery`, we check the workspace once, then load all the PHIDs. When the PHIDs are a mixture of transactions and objects, we always miss the workspace and load the objects twice.
    - Instead, check the workspace after loading each type of object.
  - `HandleQuery` does not set itself as the parent query for `ObjectQuery`, so handles never hit the workspace cache.
    - Pass it, so they can hit the workspace cache.
  - Feed's weird `PhabricatorFeedStory::loadAllFromRows()` method does not specify a parent query on its object/handle queries.
    - Just declare the object query to be the "root" query until this eventually gets cleaned up.

Test Plan: Saw queries for each object drop from 4-6x to 1x in `/feed/`.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8631

Differential Revision: https://secure.phabricator.com/D13479
2015-06-30 11:19:41 -07:00
..
__tests__ phtize all the things 2015-05-22 21:16:39 +10:00
aphront Let PhabricatorPlatformSite catch unconfigured requests 2015-06-30 07:24:06 -07:00
applications Dramatically increase cache hit rate for feed 2015-06-30 11:19:41 -07:00
docs Provide more detailed guidance on upgrading Phabricator and the "stable" branch 2015-06-25 13:57:19 -07:00
extensions Add src/extensions/ to Phabricator 2013-08-14 15:38:06 -07:00
infrastructure Dramatically increase cache hit rate for feed 2015-06-30 11:19:41 -07:00
view Spaces + Diffusion - make creating a new repository work again 2015-06-29 11:55:52 -07:00
__phutil_library_init__.php Delete license headers from files 2012-11-05 11:16:51 -08:00
__phutil_library_map__.php Modularize Aphront "sites" 2015-06-29 14:04:48 -07:00