Find oversized IN lists

Proprietary

A very long IN list is parsed and planned on every execution, tends to pollute the statement cache, and some databases hard-cap the number of elements it may contain. Loading the values into a temporary table and joining against it scales far better. IN with a subquery is not flagged.

org.openrewrite.sql.antipattern.FindOversizedInList

Optional

Flag IN lists with more values than this. Defaults to 50 when not set.

markSourceBoolean

Whether to mark each occurrence in source, and apply the fix where the rule remediates. Defaults to true; set to false to leave source untouched and report only to the data table, as an analysis-only pipeline requires.

mod run . --recipe=org.openrewrite.sql.antipattern.FindOversizedInList

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.