Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15376095
D13325.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13325.diff
View Options
diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php
--- a/src/applications/differential/query/DifferentialRevisionQuery.php
+++ b/src/applications/differential/query/DifferentialRevisionQuery.php
@@ -771,19 +771,23 @@
$this->updatedEpochMax);
}
+ // NOTE: Although the status constants are integers in PHP, the column is a
+ // string column in MySQL, and MySQL won't use keys on string columns if
+ // you put integers in the query.
+
switch ($this->status) {
case self::STATUS_ANY:
break;
case self::STATUS_OPEN:
$where[] = qsprintf(
$conn_r,
- 'r.status IN (%Ld)',
+ 'r.status IN (%Ls)',
DifferentialRevisionStatus::getOpenStatuses());
break;
case self::STATUS_NEEDS_REVIEW:
$where[] = qsprintf(
$conn_r,
- 'r.status IN (%Ld)',
+ 'r.status IN (%Ls)',
array(
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
));
@@ -791,7 +795,7 @@
case self::STATUS_NEEDS_REVISION:
$where[] = qsprintf(
$conn_r,
- 'r.status IN (%Ld)',
+ 'r.status IN (%Ls)',
array(
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
));
@@ -799,7 +803,7 @@
case self::STATUS_ACCEPTED:
$where[] = qsprintf(
$conn_r,
- 'r.status IN (%Ld)',
+ 'r.status IN (%Ls)',
array(
ArcanistDifferentialRevisionStatus::ACCEPTED,
));
@@ -807,13 +811,13 @@
case self::STATUS_CLOSED:
$where[] = qsprintf(
$conn_r,
- 'r.status IN (%Ld)',
+ 'r.status IN (%Ls)',
DifferentialRevisionStatus::getClosedStatuses());
break;
case self::STATUS_ABANDONED:
$where[] = qsprintf(
$conn_r,
- 'r.status IN (%Ld)',
+ 'r.status IN (%Ls)',
array(
ArcanistDifferentialRevisionStatus::ABANDONED,
));
diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php
--- a/src/applications/differential/storage/DifferentialRevision.php
+++ b/src/applications/differential/storage/DifferentialRevision.php
@@ -102,6 +102,14 @@
'repositoryPHID' => array(
'columns' => array('repositoryPHID'),
),
+ // If you (or a project you are a member of) is reviewing a significant
+ // fraction of the revisions on an install, the result set of open
+ // revisions may be smaller than the result set of revisions where you
+ // are a reviewer. In these cases, this key is better than keys on the
+ // edge table.
+ 'key_status' => array(
+ 'columns' => array('status', 'phid'),
+ ),
),
) + parent::getConfiguration();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 14, 1:43 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7640207
Default Alt Text
D13325.diff (2 KB)
Attached To
Mode
D13325: Improve Differential query plans
Attached
Detach File
Event Timeline
Log In to Comment