Inspectopedia
 
2024.3

Redundant row limiting in queries

Warning
New
Last modified: 03 December 2024

Reports redundant row limiting clauses like FETCH and LIMIT in queries.

Example (PostgreSQL):

To fix the warning, you can add OFFSET to limiting clauses. If OFFSET is missing, then LIMIT is redundant because the usage of LIMIT does not influence the operation result of EXISTS. In case with OFFSET, we skip first N rows and this will influence the output.