Is querying on views slower than doing one query?

前端 未结 5 788
悲哀的现实
悲哀的现实 2020-12-19 22:47

Will Mssql be even fast when I query on a view opposed to one query?

example

When I have this view:

create view ViewInvoicesWithCustomersNam         


        
5条回答
  •  庸人自扰
    2020-12-19 23:11

    They are the same, but view the execution plan so you can see what is going on. If you are having performance issues, it's likely that you need an index. Presuming Customer.ID is the primary key with a clustered index then Invoice.CustomerID and CustomerName are good candidates for an index.

提交回复
热议问题