Click here to Skip to main content
15,881,641 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I have table to store Picture as binary value in Varbinary(Max) column. Right now am having 7 set of records which all has the varbinary value. It takes around 20 seconds to retrieve those data using following query

SQL
Select Id,Name,ImageData,Date
From ContentPicture


If 7 records itself makes 20 seconds , then it will take much more time for retrieve more records. Can you please suggest me to how to retrieve those records efficiently.

I am converting those binary data into image and displaying in my application, so totally it takes 2 - 3 mins to display an image.

Please help me out...

Thank in advance.
Posted
Comments
Sergey Alexandrovich Kryukov 21-Aug-14 1:10am    
20 seconds? Sounds absolutely insane. It cannot be cured by better queries. The whole setting must be awfully wrong. But how can we know what it is?
—SA
VigneshKumar957 21-Aug-14 1:13am    
Can't get you clearly?
PhilLenoir 21-Aug-14 9:42am    
What are the sizes of the images? I'd suggest either beefing up your database server or researching Filestream columns, but without more information it could be anything from a poor network connection to other processes overworking your database.
VigneshKumar957 21-Aug-14 23:27pm    
The size is around 100kb and i'm having 3Mbps speed. What is FileStream Columns
coded007 25-Aug-14 9:29am    
FileStream column means your column having varbinary datatype

1 solution

In order to optimize the database query, save the image in base 64 format, as string value in database. Take the data type for the image field as BLOB.

It will dramatically increase the database query
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900