Follow-up from "Allowing filtering merge requests by multiple review states"
The following discussion from !150844 (merged) should be addressed:
-
@fcatteau started a discussion: (+2 comments) @iamphill The queries seem OK but I'd like to hear what database maintainers would say.
@ahegyi WDYT?
Postgres.ai has the following recommendations:
-
Query processes too much data to return a relatively small number of rows.
I don't see how this can be improved. -
Specialized index needed
. We might indeed add a composite index for merge_request_reviewers on(user_id, state)
, but it might not be used depending on the query params. See !150844 (comment 1886652762)
Beyond that, it seems to me that this MR doesn't impact the query plans. It might give us the opportunity to discuss optimizations, but in my opinion these wouldn't be required by the MR.
@ahegyi As a DB maintainer do you think that this reasoning is valid?
-