Slow creating database
Posted: 04.03.2009, 14:24
Hello.
I'm working in a little database with SQLite. Till now I'm using CNPack for SQLite2. Works very well, It make 3 tables and 1 index in 10 seconds or less. The tables are populating with records and the greatest have 1700 records with 5 fields. I repeat, all in 10 seconds. I find Zeos components and now I'm migrating the database. But now creating the database spent 5 minutes. I test several things but doesn't work, for example
Executing all commands in this sequence
Make an script for the commands
I test also execute ZProcesoBD.Script.Clear before the generator loop and ZProcesoBD.Execute after the loop. Worst results.
I have these relations and definitions:
¿Somebody can tell me what is wrong? Or ¿Can tell me what is missing to optimize the queries? Thanks. I'm working with Delphi 2005.
I'm working in a little database with SQLite. Till now I'm using CNPack for SQLite2. Works very well, It make 3 tables and 1 index in 10 seconds or less. The tables are populating with records and the greatest have 1700 records with 5 fields. I repeat, all in 10 seconds. I find Zeos components and now I'm migrating the database. But now creating the database spent 5 minutes. I test several things but doesn't work, for example
Executing all commands in this sequence
Code: Select all
ZConsultaBD.SQL.Clear;
ZConsultaBD.SQL.Add(comandoSQL);
ZConsultaBD.Open;
Code: Select all
ZProcesoBD.Script.Clear;
ZProcesoBD.Script.Add(comandoSQL+';');
ZProcesoBD.Execute;
I have these relations and definitions:
Code: Select all
ZConexionBD.Database:=ficheroBaseDatos;
ZConexionBD.Protocol:='sqlite-3';
ZConexionBD.Connected:=TRUE;
ZConsultaBD.Connection:=ZConexionBD;
ZProcesoBD.Connection:=ZConexionBD;