Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

we have image column in our database and when we try to retreive image, it takes very long time. Is there any way to improve performance?

Any solutions apart from the below
1. Instead of saving data in DB, store it in file system.
2. using varbinary column instead of image column.
Posted
Comments
[no name] 6-Jul-12 9:28am    
"Is there any way to improve performance?" Yes but you have already discounted the correct way to do this.

1 solution

Whenever you try to retrieve large items from a database it is going to take time.
As you have seen, the best approach is to store the image in the files system and keep a location in the DB (particularly if this is giving you a big problem, as DB files have a limited size, and big images will eat that quite quickly) - but you don't want to do that.

The important thing is to only retrieve images when you actually need them - so never do
SQL
SELECT * FROM MyTable

Always specify a field list, and do not include images unless you need them.

There is a tip here which explains how I minimize loading of images in my systems: On-demand loading of images from a database[^]
 
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