Find non-sargable predicates
ProprietaryA comparison that wraps a column in a function, CAST, or arithmetic must evaluate the expression for every row, so an index on the bare column cannot be used for a range scan. Keeping the column alone on one side, e.g. amount > 100 - 1 rather than amount + 1 > 100, keeps the predicate index-eligible.
org. openrewrite. sql. antipattern. FindNonSargablePredicateOptional
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. FindNonSargablePredicateInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.