Code:
select * from fileA union all select * from fileB union all select * from fileC fetch first 10 rows only;
Say the first select statement returns 11 rows. That covers the "fetch first 10 rows only" clause, all 10 returned rows will be from the first select statement.
Is the SQL processor smart enough to know it does not need to bother executing the second and third select statements?
Comment