function (doc){if (doc.type==='slot-info'&&doc.config.projects&&Array.isArray(doc.config.projects)){doc.config.projects.forEach(function (project){if (project.checkout_opts&&project.checkout_opts.merges&&Array.isArray(project.checkout_opts.merges)){project.checkout_opts.merges.forEach(function (merge){emit([project.name,merge[0]],merge);});}});}}
with which we can obtain the slots including a given MR with ?key=["LHCb",2255] and e.g. the slots that include any MR of a project with ?startkey=['Moore',0]&endkey=['Moore',{}])
I think we can make a single query giving multiple keys, so we can at least get the view values in one go. If we put all we need there it will be fast. Let me think a bit