January 9, 2012 at 5:22 am
I am trying to retrieve data from a varbinary field from a table which has about half a million records.
The query i am running is as below.
SELECT TOP 1000 [PwCAgreementNo]
,[AgreementContent]
FROM [TPCut].[dbo].[tblAgreement]..
selecting even 1000 records is taking more than 5 minutes.I have removed that column and then it returns in seconds.
So, any help on available methods in sql to retrieve data from a varbinary field would be helpful for me.
Regards
Partha
January 9, 2012 at 5:30 am
Ya but how much data is 1000 rows and how does the server chooses to access this data?
TOP is one of the last operations in the plan, it usually follows a scan of the whole table (all the rows).
Why do you want to return so much data to the client. Usually anything above a few 100 rows will no be consumed bu humans.
January 9, 2012 at 2:39 pm
I assume that it is a varbinary(MAX) column. So your performance issue has to do with how SQL Server stores BLOB data. It has to do extra work to retrieve the BLOB. Check out this article for details (http://www.sqlmag.com/article/tsql3/varbinary-max-tames-the-blob)
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply