You have these two types of queries:
--query1 Select someFields From someTables Where someWhereClues Union all Select someFields FROM some Tables Where someWhereClues --query2 Select * FROM ( Select someFields From someTables Union all Select someFields FROM someTables ) DT Where someMixedWhereClues
Note:
In both queries, the final result fields are the same.
I thought 1st. the query is faster or its performance is better!
But after some research, I confused this note :
SQL Server (as a sample RDBMS) first reads the whole data, and then searches for records. => so that both queries will record and search for all records.
Please help me with my misunderstandings and whether there are any other differences between query1 and query2?
Edit : adding sample plans:
select t.Name, t.type from sys.tables t where t.type = 'U' union all select t.Name, t.type from sys.objects t where t.type = 'U' select * from ( select t.Name, t.type from sys.tables t union all select t.Name, t.type from sys.objects t ) dt where dt.type = 'U'
Implementation Plans: 

both are the same and 50%
shA.t source share