Subject Re: client-java driver pretty slow
Author Luca Lafranchi
> Could you provide a simple example (ideally a junit test) that
> the slowing down?

OK, I've done some time measuring tests (coded directly in my
application, without using junit, at the moment). The code is really

long ftime = System.currentTimeMillis();
ResultSet resultSet = statement.executeQuery(query);
long stime = System.currentTimeMillis();
System.out.println("Query time: "+(stime-ftime));

I measured first with the Firebird Interclient driver and then with
the client-java. Here are only two examples.

Table portfolio has 12 rows; mandant_id is a foreign key referencing
mandant.id_ref (table mandant has 7 rows).

"select * from portfolio where mandant_id= 1 order by nummer"
ic : Query time: 10
c-j: Query time: 320

Table koeffizienten has 477 rows; objekt_id is a foreign key
referencing objekte.id_ref (table objekte has 34 rows).

"select koeffizient , bezeichnung , zusammenges , calculated , formel
, wert , einheit , isAnalyseGew , id_ref from koeffizienten WHERE
objekt_id = 5 order by sortierpos"
ic : Query time: 10
c-j: Query time: 3124

This is only to show you the difference between the two drivers, but
continuing to use the client-java, I've seen that "Query time" remains
between 3000 and 4100 millisecs, even with small tables (with some
exceptions when it falls down to 300-350).
Could it be that the transaction's "start...end...commit" sequence
(performed for each query) is taking to much time, and not the actual
time needed to fetch the data?

Note: while performing the queries, the javaw process uses 99% of CPU.

Hope this is helpful :)