SQL Server: select on a table that contains a blob

北城以北 提交于 2019-12-11 10:59:59

问题


My app is querying - among the rest - a table that has a blob column and other metadata columns (no other LOB columns).

I've read that if the object itself is not too big, it may still be stored inside the table and not as a link to itself. In this case, a 'SELECT' statement on such a table, even if it does not contain the blob, like:

SELECT Date FROM MyTable

might still retrieve the blob (in the server only), thus taking longer to perform.

Is this true? Can anyone provide an explanation or a link to one?

My background in SQL is rather basic, so I might not be accurate, sorry.

Thanks.


回答1:


If you create a non-clustered index on the date column, then you can retrieve the data by scanning the index, instead of scanning the entire table. You should see I/O go way down.



来源:https://stackoverflow.com/questions/11671226/sql-server-select-on-a-table-that-contains-a-blob

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