Click here to Skip to main content
12,828,699 members (50,368 online)
Rate this:
Please Sign up or sign in to vote.
See more: SQL
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

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 20-Aug-14 19:26pm
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?
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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170326.1 | Last Updated 11 Sep 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100