Click here to Skip to main content
Rate this: bad
good
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 18:26pm
Comments
Sergey Alexandrovich Kryukov at 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 at 21-Aug-14 1:13am
   
Can't get you clearly?
PhilLenoir at 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 at 21-Aug-14 23:27pm
   
The size is around 100kb and i'm having 3Mbps speed. What is FileStream Columns
coded007 at 25-Aug-14 9:29am
   
FileStream column means your column having varbinary datatype

1 solution

Rate this: bad
good
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
  Permalink  

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

  Print Answers RSS
0 CPallini 335
1 BillWoodruff 309
2 Sergey Alexandrovich Kryukov 290
3 George Jonsson 274
4 Gihan Liyanage 230
0 OriginalGriff 4,895
1 CPallini 4,010
2 Sergey Alexandrovich Kryukov 3,514
3 George Jonsson 2,826
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 11 Sep 2014
Copyright © CodeProject, 1999-2014
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