Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Speed when Reading a Large Memo Field
Wed, Jan 11 2006 9:42 AMPermanent Link

Assoes
Hi

I have a Large Memo Field (about 30 MBytes) if I read using the stream
using this code :


TMemoryStream *Buffer;
Buffer=new TMemoryStream;
((TBlobField *)FDataLink->Field)->SaveToStream(Buffer);


It's a lot of time (minutes) to read the Memo Field. But if I use
property AsString of Field using this code :

AnsiString Buffer;
Buffer=FDataLink->Field->AsString;


It read the Memo Field very fast (a few seconds) my answer is :

Why using Stream is very more slowly than use AsString ?
What's the best way to read a large Memo Field ?

Regards
Robert
Wed, Jan 11 2006 4:48 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Robert,

<< Why using Stream is very more slowly than use AsString ? >>

Are you performing the AsString test right *after* performing the stream
test ?  If so, then you'll be benefitting in the second test from buffering
done in the first test.

<< What's the best way to read a large Memo Field ? >>

It doesn't matter - all ways call the same internal engine methods.  I will
say this, however - you should try to bump up the BLOB block size if you're
storing 30-meg BLOBs and you still are using the default BLOB block size of
512 bytes per block for the table.  You can use the TDBISAMTable.AlterTable
method or SQL ALTER TABLE statement to change the table's BLOB block size:

http://www.elevatesoft.com/dbisam4d5_creating_altering_tables.htm

--
Tim Young
Elevate Software
www.elevatesoft.com

Image