SQL Server performance and fully qualified table names

后端 未结 5 1592
感动是毒
感动是毒 2021-01-12 02:30

It seems to be fairly accepted that including the schema owner in the query increases db performance, e.g.:

SELECT x FROM [dbo].Foo vs SELECT x FR

5条回答
  •  长发绾君心
    2021-01-12 02:50

    One thing to keep in mind is that this is a compilation binding, not an execution one. So if you execute the same query 1 million times, only the first execution will 'hit' the look up time, the rest will reuse the same plan and plans are pre-bound (names are already resolved to object ids).

提交回复
热议问题