Skip to content

Make it clearer that `scope_to` needs an index to work well

Dylan Griffith requested to merge document-risk-of-scope-to into master

What does this MR do and why?

Make it clearer that scope_to needs an index to work well

This discussion came up in Slack (internal) and at !166812 (comment 2145000488) as it seems like these docs don't highlight the risks of using where clauses or scope_to before the each_batch methods. Right now we only have a NOTE at the end but if someone is just quickly looking for code snippets or looking at the headings they might miss this. Given that many of us agreed it is usually better not to do this I opted to highlight the importance of the index at:

  1. The heading
  2. The first paragraph
  3. As a comment inside the code

Hopefully this should make it harder to miss

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Merge request reports

Loading