diff options
author | Toon Claes <toon@gitlab.com> | 2018-09-18 17:32:21 +0200 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2018-09-20 16:27:09 +0200 |
commit | ce830d3c60fbf445c67fb923f03678ad2333eba5 (patch) | |
tree | 68a6b4a82244e15eb9c81d697ae9ac2cacad3642 /doc/development/README.md | |
parent | 8c2192943a5efc4d0a28c67b04bf9b979def66a1 (diff) | |
download | gitlab-ce-ce830d3c60fbf445c67fb923f03678ad2333eba5.tar.gz |
Add Gitlab::Database::Subquery.self_join to delete_all with limit
`delete_all` doesn't support limit, so you'd need to subquery
that. And instead of subquerying with `where(id: query)`, it's better
to use an `INNER JOIN`. This method also works with MySQL, while
subquerying doesn't (without another layer of subquerying)
Reference:
https://stackoverflow.com/questions/17892762/mysql-this-version-of-mysql-doesnt-yet-support-limit-in-all-any-some-subqu/17892886#17892886
Diffstat (limited to 'doc/development/README.md')
-rw-r--r-- | doc/development/README.md | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/doc/development/README.md b/doc/development/README.md index d8dbc993442..94e604d125d 100644 --- a/doc/development/README.md +++ b/doc/development/README.md @@ -94,6 +94,7 @@ description: 'Learn how to contribute to GitLab.' - [Verifying database capabilities](verifying_database_capabilities.md) - [Database Debugging and Troubleshooting](database_debugging.md) - [Query Count Limits](query_count_limits.md) +- [Database helper modules](database_helpers.md) ## Testing guides |