summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Read <eread@gitlab.com>2019-07-26 01:23:56 +0000
committerEvan Read <eread@gitlab.com>2019-07-26 01:23:56 +0000
commit8b7030751cafea606617dfdcfff0ce70d11238f1 (patch)
tree580059ac0af49f6ef1ee159eb4b49d618b0897eb
parent9e91ae15a8194e75e2bc0703d51babb25d161807 (diff)
parent412a0a6722baf54c638416e5f9052215991885a4 (diff)
downloadgitlab-ce-8b7030751cafea606617dfdcfff0ce70d11238f1.tar.gz
Merge branch 'ab-dbreview-prep' into 'master'
Add points how to prepare for database reviews Closes #65126 See merge request gitlab-org/gitlab-ce!31158
-rw-r--r--doc/development/database_review.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/development/database_review.md b/doc/development/database_review.md
index 1413c2f69fb..3d10a0c84e5 100644
--- a/doc/development/database_review.md
+++ b/doc/development/database_review.md
@@ -68,6 +68,17 @@ make sure you have applied the ~database label and rerun the
`danger-review` CI job, or pick someone from the
[`@gl-database` team](https://gitlab.com/groups/gl-database/-/group_members).
+### How to prepare for speedy database reviews
+
+In order to make reviewing easier and therefore faster, please consider preparing a comment
+and details for a database reviewer:
+
+- Provide queries in SQL form rather than ActiveRecord.
+- Format any queries with a SQL query formatter, for example with [sqlformat.darold.net](http://sqlformat.darold.net).
+- Consider providing query plans via a link to [explain.depesz.com](https://explain.depesz.com) or another tool instead of textual form.
+- For query changes, it is best to provide the SQL query along with a plan *before* and *after* the change. This helps to spot differences quickly.
+- When providing query plans, make sure to use good parameter values, so that the query executed is a good example and also hits enough data. Usually, the `gitlab-org` namespace (`namespace_id = 9970`) and the `gitlab-org/gitlab-ce` project (`project_id = 13083`) provides enough data to serve as a good example.
+
### How to review for database
- Check migrations