Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add desc indexes to optimize desc query (#72)
We have stress testing, therefore We could find performance issue like this. With the tests, I noticed a significant performance dropped on some query (look at warmup tests before image), then after some search the fix is quite easy: It just needs some more indexes in our database. With this small changes the improve in performance is staggering. With `Stress Simulation` test, the at 99% tile, it is 2000% faster and 3000% time faster in `mean` value. With `Capacity Simulation` test, the failed requests are reduce from 81% to 0%, and there is almost no different between 0 rps and 240 rps. So, these stress tests are meaningless now, I'll increase load for these stress tests in another PR. Screenshot of the results before and after: Before: <img width="1012" alt="Screenshot 2024-04-28 at 08 38 11" src="https://github.com/lenguyenthanh/fide/assets/437967/5476051e-805d-4a52-80e6-b6449442493a"> After: <img width="1026" alt="Screenshot 2024-04-28 at 08 51 56" src="https://github.com/lenguyenthanh/fide/assets/437967/725164e7-76de-4233-866a-f9e54bce4abb"> Before: <img width="1026" alt="Screenshot 2024-04-28 at 08 36 58" src="https://github.com/lenguyenthanh/fide/assets/437967/41f61d56-1a56-4785-a778-139e3850582c"> After: <img width="1039" alt="Screenshot 2024-04-28 at 08 16 00" src="https://github.com/lenguyenthanh/fide/assets/437967/1692400d-10bc-4fe0-bdfd-e5a2ee614a17"> Before: <img width="1038" alt="Screenshot 2024-04-28 at 08 42 38" src="https://github.com/lenguyenthanh/fide/assets/437967/d8f992e0-2346-4632-b5c5-7ee92cbf0a00"> After: <img width="1036" alt="Screenshot 2024-04-28 at 08 55 00" src="https://github.com/lenguyenthanh/fide/assets/437967/716b0e81-c097-40f2-8d02-a9b7c0c805bb">
- Loading branch information