When doing a scan which is expected to return the exact same number of rows as the LIMIT we give, we still scan the entire table until we return the row(s) and then test the numbers of rows we have. This can take a lot of time.
This is because we will break on the limit condition AFTER we ask for the next row. If there is none, we scan the entire table than exit.
Goal of this patch is to handle this specific case without impacting the others.