I'm having some problems with query performance with the embedded
version of Firebird (1.5.3 - newest stable). I'm using .NET and
the "standard" Firebird ADO.NET driver (1.7).
When I'm running the query through the server, the query takes like
0.1 sek but one second when I connect using the embedded version
(the CPU goes to 100% all the time).
From the .NET layer it's just a simple query:
select id, snapdate, filename, filesize, program, programcaption,
duration from activity where snapdate between @date1 and @date2 and
filename is not null order by snapdate
The table has like 5000 rows per day and the query is normally selecting data for a whole day (=> returns 5000 rows)
I profiled it and it seems to point the the "embedded fetch" method
in fbembed.dll (through PInvoke).
The connection string is as basic as possible:
Server:
"Database=C:\msc\timeSnapper\v2.0\bin\TimeSnapper.fdb;
Userid=SYSDBA; Password=masterkey; DataSource=localhost; Port=3050;
ForcedWrite=true"
Embedded:
"Database=C:\msc\timeSnapper\v2.0\bin\TimeSnapper.fdb;
Userid=SYSDBA; Password=masterkey; ServerType=1; ForcedWrite=true"
Can anyone shed some light on this? It would be greatly
appreciated :)
Best regards,
Atli B.
ps. this is the table definition:
CREATE TABLE ACTIVITY (
ID INTEGER NOT NULL,
SNAPDATE TIMESTAMP NOT NULL,
FILENAME VARCHAR(500),
FILESIZE INTEGER,
PROGRAM VARCHAR(100),
PROGRAMCAPTION VARCHAR(1000),
DURATION INTEGER
);
ALTER TABLE ACTIVITY ADD PRIMARY KEY (ID);
CREATE INDEX IDX_ACT_SNAPDATE ON ACTIVITY (SNAPDATE);
