commit | f3cdd45e9e3bc2361e87ae2542079331e20c93cd | [log] [tgz] |
---|---|---|
author | David Ostrovsky <david@ostrovsky.org> | Sun Apr 09 12:22:31 2017 +0200 |
committer | Hugo Arès <hugo.ares@ericsson.com> | Tue Apr 25 09:55:45 2017 +0000 |
tree | f58de29257eecc5c01d49f864fbd179bb095a477 | |
parent | 336db37b9b80aa54f63bfdf4b3bdd982676b0bc7 [diff] |
GET files?reviewed: Don't fire N+1 selects for N patch sets If current patch set doesn't have any reviewed bit set on any files set by current user, the algorithm iterates over all patch sets in reversed order, fires dedicated select statement for each patch set and copies the reviewed bits from the latest patch set found, where reviewed bits were set. There is off by one mistake in the current implementation, so that the select for the current patch set is fired twice. In the worst case the current implementation also fires N+1 select statements for N patch set. Especially on big gerrit sites, we have seen changes with three digits patch set number, so that we eventualy spawn hundreds of select statements with the current approach to load only one single change. This is a known anti pattern in SQL DML domain, to span dynamic number of select statements, that depends on the current input (change). To rectify, express the desired query with SQL. For a given user, change and specific patch set (that is not necessarily the current patch set of the change), find a patch set with max patch set number, that is smaller or equals to the given patch set, with reviewed bit set. Bug: Issue 5907 Change-Id: I09d345f6a396d1c9ceea4a2135f539ea073f59cd
Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The IRC channel on freenode is #gerrit. An archive is available at: echelog.com.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Buck and run the following:
git clone --recursive https://gerrit.googlesource.com/gerrit cd gerrit && buck build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update & apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.