SQL Server 从类型 varbinary(max) 中慢速选择查询 [英] SQL server slow select query from type varbinary(max)

查看:52
本文介绍了SQL Server 从类型 varbinary(max) 中慢速选择查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表,其中一列的类型为 [Data](varbinary(max),not null).我保存了一行,我检查了图像大小的大小:

I have a table which one of the columns with type [Data] (varbinary(max), not null). I saved one row, and I checked the size of the image size:

SELECT SUM(Datalength(Data)) FROM t_photo where id=2256 => 355249

当我执行查询时:

select data from t_photo where id=2256

大约需要 10 秒

我可以做些什么来缩短这个查询时间?

What can I do to lower this query time?

推荐答案

我的解决方案不是将图像的字节数组保存在 th DB 中,而是将图像存储在 blob 存储中,而在 db 中只保存此图片的网址

My solution was not to save the byte array of the image in th DB, but to store the image in the blob storage, and save in the db only the URL of this image

这篇关于SQL Server 从类型 varbinary(max) 中慢速选择查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆