Will Mssql be even fast when I query on a view opposed to one query?
example
When I have this view:
create view ViewInvoicesWithCustomersName
Select * from Invoices left join Customer on Customer.ID=Invoices.CustomerID
What will be faster or will it be even fast?
a) select * from ViewInvoicesWithCustomersName where customerName="Bart"
b) select * from Invoices left join Customer on Customer.ID=Invoices.CustomerID
where customername="Bart"
Whilst in your simple example things will be the same some caution is necessary with using nested views.
I worked on a system where queries were timing out after 30 seconds built on about 6 levels of nested views and managed to speed these up by a factor of about 100 by rewriting the queries against the base tables.
A simple example of the type of issue that can arise is below.