I have the query below :

SELECT MIN(to_number(a.ADDRESS)) + 1
FROM BUSINESS a
WHERE upper(a.ADDRESS) = lower(a.ADDRESS)
AND to_number(a.ADDRESS) >= 11511
AND (to_number(a.ADDRESS)+1) NOT IN
(SELECT to_number(b.ADDRESS)
FROM BUSINESS b
WHERE upper(b.ADDRESS) = lower(b.ADDRESS) )


it failed at first so I analyze the table and it run ok. why is it failed in the first place without analyzing the table????