TIBCTable performance
Posted: Thu 15 Nov 2018 21:57
I am migrating a console application programmed with C ++ Builder. The current application uses Advantage Database Server (ADS) and its API. The new application uses Interbase 2017 and the TICBTable components.
I copy below a small example of how I am implementing it:
#include <vcl.h>
#include <windows.h>
#pragma hdrstop
#pragma argsused
#include <stdio.h>
#include "DBAccess.hpp"
#include "IBC.hpp"
#include <Data.DB.hpp>
int _tmain(int argc, _TCHAR* argv[])
{
TIBCConnection *IBCConnection = new TIBCConnection(NULL);
IBCConnection->Server = "localhost";
IBCConnection->AutoCommit = true;
IBCConnection->Username = "sysdba";
IBCConnection->Password = "masterkey";
IBCConnection->Database = "C:\\SirFullWeb\\E001076\\DbHaberes\\DbHaberes2.IB";
IBCConnection->Connect();
TIBCTable *IBCTable = new TIBCTable(NULL);
IBCTable->Connection = IBCConnection;
IBCTable->TableName = "Elresumen";
IBCTable->AutoCommit = true;
IBCTable->Active = true;
TStringList * Keys = new TStringList;
IBCTable->GetKeyFieldNames(Keys);
Keys->Delimiter = ';';
IBCTable->IndexFieldNames = Keys->DelimitedText;
IBCTable->First();
while (!IBCTable->Eof) {
printf("Empresa: %d Empleado: %d Anio: %d Mes: %d Liquidacion: %s Agrupamiento %s \n",IBCTable->Fields->Fields[0]->AsInteger,IBCTable->Fields->Fields[1]->AsInteger,IBCTable->Fields->Fields[2]->AsInteger,IBCTable->Fields->Fields[3]->AsInteger,AnsiString(IBCTable->Fields->Fields[4]->AsString).c_str(),AnsiString(IBCTable->Fields->Fields[5]->AsString).c_str());
IBCTable->Next();
}
IBCTable->Free();
IBCConnection->Disconnect();
IBCConnection->Free();
return 0;
}
How can I increase the performance? Is there an IBC DBART API like the ADS or Paradox Engine API?
The application uses LOCATE and Next () repeatedly and the performance with Interbase is much slower than with ADS.
Regars
I copy below a small example of how I am implementing it:
#include <vcl.h>
#include <windows.h>
#pragma hdrstop
#pragma argsused
#include <stdio.h>
#include "DBAccess.hpp"
#include "IBC.hpp"
#include <Data.DB.hpp>
int _tmain(int argc, _TCHAR* argv[])
{
TIBCConnection *IBCConnection = new TIBCConnection(NULL);
IBCConnection->Server = "localhost";
IBCConnection->AutoCommit = true;
IBCConnection->Username = "sysdba";
IBCConnection->Password = "masterkey";
IBCConnection->Database = "C:\\SirFullWeb\\E001076\\DbHaberes\\DbHaberes2.IB";
IBCConnection->Connect();
TIBCTable *IBCTable = new TIBCTable(NULL);
IBCTable->Connection = IBCConnection;
IBCTable->TableName = "Elresumen";
IBCTable->AutoCommit = true;
IBCTable->Active = true;
TStringList * Keys = new TStringList;
IBCTable->GetKeyFieldNames(Keys);
Keys->Delimiter = ';';
IBCTable->IndexFieldNames = Keys->DelimitedText;
IBCTable->First();
while (!IBCTable->Eof) {
printf("Empresa: %d Empleado: %d Anio: %d Mes: %d Liquidacion: %s Agrupamiento %s \n",IBCTable->Fields->Fields[0]->AsInteger,IBCTable->Fields->Fields[1]->AsInteger,IBCTable->Fields->Fields[2]->AsInteger,IBCTable->Fields->Fields[3]->AsInteger,AnsiString(IBCTable->Fields->Fields[4]->AsString).c_str(),AnsiString(IBCTable->Fields->Fields[5]->AsString).c_str());
IBCTable->Next();
}
IBCTable->Free();
IBCConnection->Disconnect();
IBCConnection->Free();
return 0;
}
How can I increase the performance? Is there an IBC DBART API like the ADS or Paradox Engine API?
The application uses LOCATE and Next () repeatedly and the performance with Interbase is much slower than with ADS.
Regars