Homec4science

Faster 'All Revisions and Reviews' Query

Authored by elynde <elynde@facebook.com> on Apr 30 2011, 02:10.

Description

Faster 'All Revisions and Reviews' Query

Summary:
The 'All Revisions and Reviews' Query takes about 2 seconds when I run
it from the mysql command-line:

SELECT revision.*
FROM differential_revision revision LEFT JOIN
differential_relationship relationship
ON revision.id = relationship.revisionID
AND relationship.relation = 'revw'
WHERE revision.authorPHID in ('PHID-USER-a113b9ae4ee9524d0a20') OR
relationship.objectPHID in ('PHID-USER-a113b9ae4ee9524d0a20')
GROUP BY revision.id ORDER BY dateModified DESC

2419 rows in set (2.05 sec)

This takes about 0.1-0.2 seconds. Just dug into this because I guess
phabricator is haven't a bunch of mysql timeouts.

I don't know what the hell I'm doing; this is just faster

Test Plan:
Loaded 'All Revisions and Reviews' in sandbox

http://phabricator.dev1577.snc6.facebook.com/differential/filter/related/

Made sure it had same results as the version in prod

https://phabricator.fb.com/differential/filter/related/

Still slow to generate all that html

Reviewed By: epriestley
Reviewers: epriestley, aran, tuomaspelkonen, jungejason
CC: aran, epriestley
Differential Revision: 182

Details

Committed
elynde <elynde@facebook.com>May 3 2011, 20:51
Pushed
aubortJan 31 2017, 17:16
Parents
rPH497a2eec6ac3: Remove landing page
Branches
Unknown
Tags
Unknown

Event Timeline

elynde <elynde@facebook.com> committed rPH2e96565f675d: Faster 'All Revisions and Reviews' Query (authored by elynde <elynde@facebook.com>).May 3 2011, 20:51