Why do these clauses affect SQL performance?
select ID from some_table where row_status in ('I','U') order by ID limit 5 - makes the query infinite
select top 10 ID from some_table where row_status in ('I','U') order by ID - the same
select ID from some_table where row_status in ('I','U') order by ID - is fast
Actually there are no rows in the table having row_status 'I' or 'U'.
I asked Gemini and it recommended me rewrite the query as
.jpg)
.jpg)