Re: How to provide a feedback in accessing the BLOB type data?
- From: "Pablo Castro [MS]" <pablocas@xxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 11 May 2005 19:44:07 -0700
I'll stay out of the discussion on whether it's a good idea to use BLOBs in
the database :)
To answer ZhangZQ's question below:
When fetching blobs from the server, you can do the following:
- use CommandBehavior.SequentialAccess, that will turn-off full-row
buffering in the reader so we'll pull data from the network on-demand, as
you consume it, even for values within the row.
- to fetch the value in chunks, use DataReader.GetBytes or
DataReader.GetChars with a buffer of some reasonable size (e.g. 10 or 20K,
experiment a little to find a good perf point). Between calls to
GetChars/GetBytes you can report progress.
- note that you cannot reliably know the length of the entire value
(sometimes we know it, sometimes we don't)
That will give you full streamig fetching, and you can report as you fetch.
As for sending *to* the server (in parameters), infortunately we don't have
streaming capabilities. You can send it in chunks (using WRITETEXT), but
that's painful and slow.
--
Pablo Castro
Program Manager - ADO.NET Team
Microsoft Corp.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Sahil Malik [MVP]" <contactmethrumyblog@xxxxxxxxxx> wrote in message
news:eNtnGoqUFHA.3056@xxxxxxxxxxxxxxxxxxxxxxx
> How about if there were 5 rows, 50K blobs each?
>
> But I think I understand your point.
>
> - Sahil Malik [MVP]
> http://codebetter.com/blogs/sahil.malik/
>
>
> "William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxxx> wrote in message
> news:eZzzc5eUFHA.3244@xxxxxxxxxxxxxxxxxxxxxxx
>> Ah, backups are another reason to keep BLOBs out of the database. They
>> make the backup take longer, consume more space--and in too many cases
>> these BLOBs are RO so they don't change from time to time. It's far
>> faster to copy the files to a DVD and keep them safe there--once.
>>
>> --
>> ____________________________________
>> William (Bill) Vaughn
>> Author, Mentor, Consultant
>> Microsoft MVP
>> www.betav.com/blog/billva
>> www.betav.com
>> Please reply only to the newsgroup so that others can benefit.
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>> __________________________________
>>
>> "Sahil Malik [MVP]" <contactmethrumyblog@xxxxxxxxxx> wrote in message
>> news:OTJbZ0BUFHA.616@xxxxxxxxxxxxxxxxxxxxxxx
>>> Okay, I'm gonna be a spoil sport and say - There is one big advantage to
>>> keeping atleast small blobs in the database - "Backups".
>>>
>>> But anyway, Blobs don't belong in the db. My yardstick is, if it's
>>> greater
>>> than 50K, keep it on the filesystem.
>>>
>>> - Sahil Malik [MVP]
>>> http://codebetter.com/blogs/sahil.malik/
>>>
>>>
>>>
>>> "William (Bill) Vaughn" <billvaRemoveThis@xxxxxxxxxx> wrote in message
>>> news:#pYh5$AUFHA.584@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Or you could follow the advice of many developers and keep BLOBs out of
>>> the
>>>> database...
>>>>
>>>> --
>>>> ____________________________________
>>>> William (Bill) Vaughn
>>>> Author, Mentor, Consultant
>>>> Microsoft MVP
>>>> www.betav.com/blog/billva
>>>> www.betav.com
>>>> Please reply only to the newsgroup so that others can benefit.
>>>> This posting is provided "AS IS" with no warranties, and confers no
>>> rights.
>>>> __________________________________
>>>>
>>>> "ZhangZQ" <zhangzq71@xxxxxxxxx> wrote in message
>>>> news:u3weRcMTFHA.548@xxxxxxxxxxxxxxxxxxxxxxx
>>>> > How to let the user know the progress while accessing BLOB type data?
>>> The
>>>> > feedback such as the number of bytes readed/written to database.
>>>> >
>>>> >
>>>> > Regards,
>>>> > ZhangZQ
>>>> >
>>>>
>>>>
>>>
>>>
>>
>>
>
>
.
- References:
- Re: How to provide a feedback in accessing the BLOB type data?
- From: William \(Bill\) Vaughn
- Re: How to provide a feedback in accessing the BLOB type data?
- From: Sahil Malik [MVP]
- Re: How to provide a feedback in accessing the BLOB type data?
- From: William \(Bill\) Vaughn
- Re: How to provide a feedback in accessing the BLOB type data?
- From: Sahil Malik [MVP]
- Re: How to provide a feedback in accessing the BLOB type data?
- Prev by Date: Re: MSDE Backup
- Next by Date: Re: using Integrated Security SSPI with User ID
- Previous by thread: Re: How to provide a feedback in accessing the BLOB type data?
- Next by thread: Re: How to provide a feedback in accessing the BLOB type data?
- Index(es):
Relevant Pages
|