Subject | Processing thru blobs very slow |
---|---|
Author | nols_smit |
Post date | 2007-02-09T09:57:01Z |
Delphi 7, IBX 7.08 and FireBird 1.5.3 refers
I've created a one-table database with the following four fields:
CREATE TABLE TABLE1 (
ID INTEGER NOT NULL,
VC_NAME VARCHAR (100) CHARACTER SET WIN1252 NOT NULL COLLATE WIN1252,
BLOB_ST_0 BLOB sub_type 0 segment size 100 NOT NULL,
BLOB_ST_1 BLOB sub_type 1 segment size 100 NOT NULL);
In a Delphi Pascal program, I load the table with 100000 records,
using the same 98 character string for the VarChar and the two blob
columns.
I process thru the table using the code mentioned below. It processes
about 3 seconds if I process only the VarChar field. Halfway thru the
table, it comes to a virtual standstill if I include any blob field in
the processing. Any idea what's going on?
Another question: What's the max. varchar size in FireBird 2 I need
to process text blob fields up to 200 KB via the Rubicon indexing
components.
Regards,
Nols Smit
{====================== code mentioned =========================}
procedure TForm1.btnReadClick(Sender: TObject);
var
i: integer;
s: string;
begin
with IBQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('Select ID');
if cbVC_Name.Checked then { <--- refer to TChechBox }
SQL.Add(', VC_Name');
if cbBlob_ST_0.Checked then
SQL.Add(' ,Blob_ST_0');
if cbBlob_ST_1.Checked then
SQL.Add(' ,Blob_ST_1');
SQl.Add('from Table1 order by ID');
Open;
i := 0;
First;
while not eof do
begin
inc(i);
if i = 500 then
begin
lblProgress.Caption := FieldByName('ID').AsString;
i := 0;
Application.ProcessMessages;
end;
if cbVC_Name.Checked then
s := FieldByName('VC_Name').AsString;
if cbBlob_ST_0.Checked then
s := FieldByName('Blob_ST_0').AsString;
if cbBlob_ST_1.Checked then
s := FieldByName('Blob_ST_1').AsString;
Next;
end;
end;
end;
I've created a one-table database with the following four fields:
CREATE TABLE TABLE1 (
ID INTEGER NOT NULL,
VC_NAME VARCHAR (100) CHARACTER SET WIN1252 NOT NULL COLLATE WIN1252,
BLOB_ST_0 BLOB sub_type 0 segment size 100 NOT NULL,
BLOB_ST_1 BLOB sub_type 1 segment size 100 NOT NULL);
In a Delphi Pascal program, I load the table with 100000 records,
using the same 98 character string for the VarChar and the two blob
columns.
I process thru the table using the code mentioned below. It processes
about 3 seconds if I process only the VarChar field. Halfway thru the
table, it comes to a virtual standstill if I include any blob field in
the processing. Any idea what's going on?
Another question: What's the max. varchar size in FireBird 2 I need
to process text blob fields up to 200 KB via the Rubicon indexing
components.
Regards,
Nols Smit
{====================== code mentioned =========================}
procedure TForm1.btnReadClick(Sender: TObject);
var
i: integer;
s: string;
begin
with IBQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('Select ID');
if cbVC_Name.Checked then { <--- refer to TChechBox }
SQL.Add(', VC_Name');
if cbBlob_ST_0.Checked then
SQL.Add(' ,Blob_ST_0');
if cbBlob_ST_1.Checked then
SQL.Add(' ,Blob_ST_1');
SQl.Add('from Table1 order by ID');
Open;
i := 0;
First;
while not eof do
begin
inc(i);
if i = 500 then
begin
lblProgress.Caption := FieldByName('ID').AsString;
i := 0;
Application.ProcessMessages;
end;
if cbVC_Name.Checked then
s := FieldByName('VC_Name').AsString;
if cbBlob_ST_0.Checked then
s := FieldByName('Blob_ST_0').AsString;
if cbBlob_ST_1.Checked then
s := FieldByName('Blob_ST_1').AsString;
Next;
end;
end;
end;