You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's hard to provide any guidance without seeing the actual code...
OK, please use...
DDL:
create database 'c:\users\zg\desktop\testdb.fdb'
user 'SYSDBA'
password '1'
page_size =8192
default character set none
collation none;
createtable "testtable" (
"testfield"integer);
execute block
as
declare i int=1;
begin
while(i <=10000000) do
begininsert into"testtable"("testfield") values(:i);
i = i +1;
end
end
C#
privatevoidbutton1_Click(objectsender,EventArgse){varcsb=newFbConnectionStringBuilder(){Database=@"c:\users\zeki\desktop\testdb.fdb",DataSource="localhost",UserID="SYSDBA",Password="1"};varcn=newFbConnection(csb.ConnectionString);varcmd=newFbCommand(@"select ""testfield"" from ""testtable"" ",cn);cn.Open();varrdr=cmd.ExecuteReader();varsw=newStopwatch();sw.Start();while(rdr.Read()){_=rdr.GetInt32(0);}sw.Stop();rdr.Close();cmd.Dispose();cn.Close();MessageBox.Show(sw.Elapsed.Seconds.ToString());}
You can get result a little bit faster if you set FetchSize (Command or Connectionstring) to the max 32767. The Default is 200 only.
This reduce server roundtrip.
In the past i have made a proposal code to speed up roundabout 30%, because the client use a heavy workload with memory allocation and garbage collection, but this is ignored:-(.
Activity
cincuranet commentedon Sep 17, 2025
It's hard to provide any guidance without seeing the actual code...
Zeki-Gursoy commentedon Sep 17, 2025
OK, please use...
DDL:
C#
BFuerchau commentedon May 1, 2026
You can get result a little bit faster if you set FetchSize (Command or Connectionstring) to the max 32767. The Default is 200 only.
This reduce server roundtrip.
In the past i have made a proposal code to speed up roundabout 30%, because the client use a heavy workload with memory allocation and garbage collection, but this is ignored:-(.