Find OFFSET-based pagination

Proprietary

OFFSET n reads and throws away n rows before returning any, so each later page costs linearly more than the one before it. Parameterized offsets and large literal offsets are flagged; keyset pagination (WHERE key > last-seen ORDER BY key) reads only the requested page. Small literal offsets are not flagged.

org.openrewrite.sql.antipattern.FindOffsetPagination

Optional

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.FindOffsetPagination

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