Commit Graph

3 Commits

Author SHA1 Message Date
Stan Hu 5c8ce94052 Fix statement timeouts in RemoveRestrictedTodos migration
On GitLab.com, the RemoveRestrictedTodos background migration
encountered about 700+ failures a day due to statement timeouts.

PostgreSQL might perform badly with a LIMIT 1 because the planner is
guessing that scanning the index in ID order will come across the
desired row in less time it will take the planner than using another
index. The order_hint does not affect the search results. For example,
`ORDER BY id ASC, updated_at ASC` means the same thing as `ORDER BY id
ASC`.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52649
2018-11-04 06:01:17 -08:00
Brett Walker f5abc2e8f9 Use a CTE to remove the query timeout 2018-10-05 11:42:40 -05:00
Jarka Kadlecová 8338f9b89b Remove todos of users without access to targets migration 2018-08-07 17:34:59 +02:00