SQL server slowly selects a query from varbinary (max) type

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

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

When I execute the request:

select data from t_photo where id=2256

~ 10 seconds required

What can I do to reduce request time?

+4
source share
2 answers

My solution was not to save an array of image bytes in the database, but to store the image in blob storage and save only the URL of this image in db

+1
source

id. , -. sp_whoisactive, , .

+2

Source: https://habr.com/ru/post/1598127/


All Articles