summaryrefslogtreecommitdiff
path: root/rubocop/rubocop.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2017-02-08 18:15:47 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2017-02-10 21:51:09 +0100
commita97dcc077c68f4f320cd7a5686b9056adfef6c09 (patch)
tree85a0e97e5e46b2a2b6bad0be216361bcf2722b18 /rubocop/rubocop.rb
parent58131ac93c2a7c784c8c4f9025ef250eac4e1fa1 (diff)
downloadgitlab-ce-a97dcc077c68f4f320cd7a5686b9056adfef6c09.tar.gz
Add method for creating foreign keys concurrently
This method allows one to create foreign keys without blocking access to the source table, but only on PostgreSQL. When creating a regular foreign key the "ALTER TABLE" statement used for this won't return until all data has been validated. This statement in turn will acquire a lock on the source table. As a result this lock can be held for quite a long amount of time, depending on the number of rows and system load. By breaking up the foreign key creation process in two steps (creation, and validation) we can reduce the amount of locking to a minimum. Locking is still necessary for the "ALTER TABLE" statement that adds the constraint, but this is a fast process and so will only block access for a few milliseconds.
Diffstat (limited to 'rubocop/rubocop.rb')
0 files changed, 0 insertions, 0 deletions