-
Notifications
You must be signed in to change notification settings - Fork 841
[db] Add indices on requests db columns #7642
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
Conversation
|
edit: The PR referenced got reverted |
4917f3b to
fe88f4b
Compare
cg505
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the index also include other fields we filter by? e.g. name, status
That's a good point. I took account of what columns we filter most by and found:
So I'm thinking we add index for |
cg505
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool
|
49e76e3 to
2ad503b
Compare
cb78b6d to
8ff9489
Compare
387b30e to
0dbeae3
Compare
2ddaed2 to
2727ca2
Compare
4e3f229 to
3256d43
Compare
Separated out from #7602
The database is given an index on created_at. This is because several queries in requests.py have ORDER BY created_at statements, which can be accelerated by an index.
Tested (run the relevant ones):
bash format.sh/smoke-test(CI) orpytest tests/test_smoke.py(local)/smoke-test -k test_name(CI) orpytest tests/test_smoke.py::test_name(local)/quicktest-core(CI) orpytest tests/smoke_tests/test_backward_compat.py(local)