Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize API DB so backup system does not cause too much load on the apidb #1180

Closed
dasrecht opened this issue Aug 14, 2019 · 0 comments · Fixed by #1223

Comments

@dasrecht
Copy link
Member

commented Aug 14, 2019

Describe the bug
The backup system causes a lot of queries towards the api-db

select `environment_backup`.* from `environment_backup` inner join `environment` as `e` on `e`.`id` = `environment_backup`.`environment` where `e`.`id` = 'REDACTED' and `environment_backup`.`deleted` = '0000-00-00 00:00:00'

Explain of the query

+------+-------------+--------------------+-------+---------------+---------+---------+-------+-------+-------------+
| id   | select_type | table              | type  | possible_keys | key     | key_len | ref   | rows  | Extra       |
+------+-------------+--------------------+-------+---------------+---------+---------+-------+-------+-------------+
|    1 | SIMPLE      | e                  | const | PRIMARY       | PRIMARY | 4       | const |     1 | Using index |
|    1 | SIMPLE      | environment_backup | ALL   | NULL          | NULL    | NULL    | NULL  | 98314 | Using where |
+------+-------------+--------------------+-------+---------------+---------+---------+-------+-------+-------------+

To Reproduce
Run query against api db - queries take several seconds during the backup period

Expected behavior
Indexes / queries are optimized to not cause a big backlog of queries

@rocketeerbkw rocketeerbkw referenced this issue Sep 4, 2019
2 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.