We are using SQL Server 2014 (not SQL Azure) and I have defined a simple table to store images (.jpg) and
CREATE TABLE [dbo].[Graphic](
[GraphicID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY,
[FileName] [varchar](100) NOT NULL,
[FileDescription] [nvarchar](200) NULL,
[Image] [varbinary](max) NULL
)
max size of an image stored is 1MB, this validation is taken care on the front-end. I just inserted 15 images and the table size is 5544 KB currently. There is a primary key placed on GraphicID column. No other indexes placed.
But when I retrieve one or more images using the below (simple SELECT) query, it is taking longer time like 25 - 30 seconds.
select * from [Graphic]
where [GraphicID] = 53
Is there a faster mechanism to query images in SQL Server in less than 5 seconds ?
Is there any alternate SAVE & RETRIEVE mechanism for images in SQL Server 2014 for better performance ?
Please help.
Thanks
Bhanu
The following recommendations will help you in your SQL tuning process.
You'll find 3 sections below:
CREATE INDEX graphic_idx_graphicid ON Graphic (GraphicID);
SELECT
*
FROM
[Graphic]
WHERE
[Graphic].[GraphicID] = 53