@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove ORDER_PATH_MODIFIED from Differential

Summary:
Ref T7803. This is a performance hack, not a real order, and isn't really meaningful or pageable.

After D12158, we constraint his query on `dateModified` anyway, which should generally give the database a relatively small result set to examine.

Test Plan: Browsed Differential and Diffusion. Checked query plan, it didn't look too crazy.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7803

Differential Revision: https://secure.phabricator.com/D12361

+2 -24
+1 -1
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 786 786 ->setViewer($this->getRequest()->getUser()) 787 787 ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) 788 788 ->withUpdatedEpochBetween($recent, null) 789 - ->setOrder(DifferentialRevisionQuery::ORDER_PATH_MODIFIED) 789 + ->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED) 790 790 ->setLimit(10) 791 791 ->needFlags(true) 792 792 ->needDrafts(true)
-22
src/applications/differential/query/DifferentialRevisionQuery.php
··· 44 44 private $order = 'order-modified'; 45 45 const ORDER_MODIFIED = 'order-modified'; 46 46 const ORDER_CREATED = 'order-created'; 47 - /** 48 - * This is essentially a denormalized copy of the revision modified time that 49 - * should perform better for path queries with a LIMIT. Critically, when you 50 - * browse "/", every revision in that repository for all time will match so 51 - * the query benefits from being able to stop before fully materializing the 52 - * result set. 53 - */ 54 - const ORDER_PATH_MODIFIED = 'order-path-modified'; 55 47 56 48 private $needRelationships = false; 57 49 private $needActiveDiffs = false; ··· 894 886 'type' => 'int', 895 887 ); 896 888 break; 897 - case self::ORDER_PATH_MODIFIED: 898 - $columns[] = array( 899 - 'table' => 'p', 900 - 'column' => 'epoch', 901 - 'value' => $cursor->getDateCreated(), 902 - 'type' => 'int', 903 - ); 904 - break; 905 889 } 906 890 907 891 $columns[] = array( ··· 932 916 return 'id'; 933 917 } 934 918 return 'r.id'; 935 - case self::ORDER_PATH_MODIFIED: 936 - if (!$this->pathIDs) { 937 - throw new Exception( 938 - 'To use ORDER_PATH_MODIFIED, you must specify withPath().'); 939 - } 940 - return 'p.epoch'; 941 919 default: 942 920 throw new Exception("Unknown query order constant '{$this->order}'."); 943 921 }
+1 -1
src/applications/diffusion/controller/DiffusionBrowseController.php
··· 199 199 ->withPath($repository->getID(), $path_id) 200 200 ->withStatus(DifferentialRevisionQuery::STATUS_OPEN) 201 201 ->withUpdatedEpochBetween($recent, null) 202 - ->setOrder(DifferentialRevisionQuery::ORDER_PATH_MODIFIED) 202 + ->setOrder(DifferentialRevisionQuery::ORDER_MODIFIED) 203 203 ->setLimit(10) 204 204 ->needRelationships(true) 205 205 ->needFlags(true)