Subject | Re: [Firebird-Java] Re: GetResultSet() takes to much time |
---|---|
Author | bibade@gmx.net |
Post date | 2003-11-26T14:06:11Z |
Thanks for your mail,
separate.
First the statement is executed and then the resultset is fetched compare
the lines below.
Case 1 and case 3 only execute getResultset without navigating to the first
result while case 2 and 4 get the resultset and iterate over all results. The
times for the statement is independend of the case (1 and 2 or 3 and 4)
except some jitter because the statements are always identical.
Fragment of my first mail:
case 1 and case 2 Firebird 1.5 RC6
case 3 and case 4 reference Database
case 1 case 2 case 3 case 4 description for query
36 36 31 31 select * from ITEM where
INVOICEID = 90
96 103 1 64
statement.getResult().next() for 100 Results
This means:
e.g. case 1:
select statement takes 36 ms.
statement.getResultSet takes 96 ms.
No next() used.
e.g. case 2
select statement takes 36 ms like in case 1.
statement.getResultSet and iterating through all results (100 for this
statement) using next takes 103 ms.
This means that for executing the query till having the result you'll have
to add the two lines e.g. case 2 means 36 ms + 103 ms while case 4 only needs
31 + 64 ms for doing the same.
database has to deliver all data.
read committed.
Tom
--
GMX Weihnachts-Special: Seychellen-Traumreise zu gewinnen!
Rentier entlaufen. Finden Sie Rudolph! Als Belohnung winken
tolle Preise. http://www.gmx.net/de/cgi/specialmail/
+++ GMX - die erste Adresse f�r Mail, Message, More! +++
>statement execution and getResultSet (inclusive iterating)are measured
> > I'm doing some test with different database systems. In my tests,
> > Firebird seems to be slow in getting the ResultSet. That takes times
> > longer than with the compared database systems. The measured times
> > [ms] for the query's are listed below (Firebird and one concurrent
> > database). I'm using JDBC (JayBird 1.01), Firebird 1.5 RC6
> > (WindowsXP and Linux) and J2SE. Statement and ResultSet are used
> > with default settings. I did the test in different ways (using a
> > fast and slow pc and mixed network access) and it seems that the
> > performance for statement.getResultSet() depends on the server not
> > the client. So performance for statement.getResultSet() seems to
> > be a problem of Firebird and not JayBird.
> >
> > Is there a posibility to get better performance for getResultSet()?
> > Is this dependend of the character set the database is set up with?
> > This test was running with charset NONE.
>
> Do you measure complete statement execution, not only fetching the
> result set?
separate.
First the statement is executed and then the resultset is fetched compare
the lines below.
Case 1 and case 3 only execute getResultset without navigating to the first
result while case 2 and 4 get the resultset and iterate over all results. The
times for the statement is independend of the case (1 and 2 or 3 and 4)
except some jitter because the statements are always identical.
Fragment of my first mail:
case 1 and case 2 Firebird 1.5 RC6
case 3 and case 4 reference Database
case 1 case 2 case 3 case 4 description for query
36 36 31 31 select * from ITEM where
INVOICEID = 90
96 103 1 64
statement.getResult().next() for 100 Results
This means:
e.g. case 1:
select statement takes 36 ms.
statement.getResultSet takes 96 ms.
No next() used.
e.g. case 2
select statement takes 36 ms like in case 1.
statement.getResultSet and iterating through all results (100 for this
statement) using next takes 103 ms.
This means that for executing the query till having the result you'll have
to add the two lines e.g. case 2 means 36 ms + 103 ms while case 4 only needs
31 + 64 ms for doing the same.
> Firebird might delay data fetching from disk until youThis should make no difference in case 2 and 4 because in thes cases each
> call ResultSet.netx() and other databases might do it differently.
database has to deliver all data.
>The whole test is running in auto-commit = off mode. Isolation is set to
> Also note, that in auto-commit mode (this is default mode according to
> specs), driver fetches complete result set locally, so there should be
> no big difference between "stmt.execute(); rs = stmt.getResultSet();"
> and "stmt.execute(); rs = stmt.getResultSet(); while(rs.next()) {}",
> since all data are already fetched.
read committed.
>Thanks for this hint.
> Also, if you wish, you can check AS3AP test suite for Firebird and try
> to adapt it for the "other DB". In this case we will be able to
> compare them using some standard metrics.
>Best regards
> Best regards,
> Roman Rokytskyy
>
Tom
--
GMX Weihnachts-Special: Seychellen-Traumreise zu gewinnen!
Rentier entlaufen. Finden Sie Rudolph! Als Belohnung winken
tolle Preise. http://www.gmx.net/de/cgi/specialmail/
+++ GMX - die erste Adresse f�r Mail, Message, More! +++