Computed columns sometimes missing from SELECT *

被刻印的时光 ゝ 提交于 2019-12-05 02:43:14

Please, refer this article: SELECT * AND SQL Azure.

Its author strongly recommend to replace

SELECT *
FROM TableName

with

SELECT [Column1], [Column2], ... [ColumnN]
FROM TableName

because Using SELECT * can cause extra paging, RFID lookups, unneeded table locking and hinders any future attempts to create a covered index. In summary, it is bad for performance.

By The Way: here you've got a set of interesting articles:

  1. How to get to SQL Azure Query Performance Data
  2. Query Performance
  3. Getting Started with the Windows Azure Tools for Visual Studio
  4. Getting Started with SQL Azure Development
  5. Improving Your I/O Performance
  6. Analyzing Query Performance just got easier with SQL Azure.

I suspect that GetOrdinary("IsExpired") causes System.IndexOutOfRangeException because of above behaviour of MS SQL Azure framework.

Conclusion? Use SELECT statement with defined list of columns to improve performance of SQL Azure database and avoid IndexOutOfRange exception.

Looking at some old logs, settled on the conclusion that this error was only happening when the queries were running while a DACPAC was concurrently being deployed (as part of our automated deployments to this particular test environment).

I assume that the schema is not necessarily in a dependable state during DACPAC deployment.

Since then, we've added some code to put the app into a "maintenance mode" during deployments, (even these automated ones). This seems to mitigate the issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!