Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a proper index to
Upload
(aka ReportSession
)
This adds an index covering `report_id` and `upload_type`, in that order. The most frequent queries use `report_id`, and some further index by `upload_type`. So this newly added index will cover those two frequent queries. Indexing additionally on `order_number` is not necessary. While we do run queries using all three fields, those are not as frequent, and they should be served by the newly added index as well. One more argument against indexing on the `order_number` is that we `UPDATE` this field when processing an upload, which means we would have to touch and update the index on such operation as well, which we could also avoid.
- Loading branch information