OhMyBug

logic/correctness

Limit Before Filter

#41rare24 sightingsfirst seen September 2026

What goes wrong

A row cap (LIMIT, slice, page size) is applied before the filter, dedup or merge that decides which rows qualify. Unqualified rows use up the cap, qualified rows are cut off, and the 'has more' flag is wrong.

Example

Fetch the first 10 rows from the database, then filter in code: 3 remain, though 20 matching rows exist and the page says 'no more'.

Not to be confused with

The order of limit and filter is the defect — not a wrong label on what was counted (Aggregate measures the wrong population) and not a partial total presented as complete (Partial measurement claims complete coverage).

Discovered by

Field notes · 11