Subject | Re: firebirdsql vs interclient speed |
---|---|
Author | llafranc78 |
Post date | 2002-02-07T10:12:13Z |
Oh...I see that you are doing an update and I'm doing a query...
Well, let's make order :)
Note: the code is not exactly the real one, but this is how I get a
connection and make a query/insert.
QUERIES: select a row containing a 8578 Kb jpg picture
localhost -> interclient : 6099 ms
firebirdsql : 6429 ms
network -> interclient : 1045 ms
-> firebirdsql : 5565 ms
Sample code:
Connection conn = DriverManager.getConnection(....);//Usual URL,user
and password
Statement stmt = connection.createStatement();
long s = System.currentTimeMillis();
ResultSet rset = stmt.executeQuery("select pic_obj from pics where
id_ref=1");
Vector data = new Vector();
while(rset.next()){
data.addElement( rset.getBytes(1) );//The blob object
}
rset.close();
conn.commit();
long e = System.currentTimeMillis();
System.out.println("Needed time: "+(e-s));
INSERTS: inserting a 8578 Kb jpg image
localhost -> interclient 1342 ms
-> firebirdsql 1193 ms
network -> interclient 470 ms
-> firebirdsql 20(!!!!) ms
Sample code:
FileInputStream fis = new FileInputStream(picture);//picture is a
File object...
Connection conn = DriverManager.getConnection(...);
PreparedStatement pstmt = conn.prepareStatement("insert into pics
(id_ref,pic_obj) values (?,?)");
pstmt.setLong(1,2);
pstmt.setBinaryStream(2,fis,fis.available());
long s = System.currentTimeMillis();
pstmt.executeUpdate();
pstmt.close();
conn.commit();
long e = System.currentTimeMillis();
System.out.println("Time needed: "+(e-s));
I couldn't find any lack of performance in neither in interclient nor
in firebirdsql.
As you can see I don't use the Borland's components: I simply use the
JDBC api.
Ciao
Luca
Well, let's make order :)
Note: the code is not exactly the real one, but this is how I get a
connection and make a query/insert.
QUERIES: select a row containing a 8578 Kb jpg picture
localhost -> interclient : 6099 ms
firebirdsql : 6429 ms
network -> interclient : 1045 ms
-> firebirdsql : 5565 ms
Sample code:
Connection conn = DriverManager.getConnection(....);//Usual URL,user
and password
Statement stmt = connection.createStatement();
long s = System.currentTimeMillis();
ResultSet rset = stmt.executeQuery("select pic_obj from pics where
id_ref=1");
Vector data = new Vector();
while(rset.next()){
data.addElement( rset.getBytes(1) );//The blob object
}
rset.close();
conn.commit();
long e = System.currentTimeMillis();
System.out.println("Needed time: "+(e-s));
INSERTS: inserting a 8578 Kb jpg image
localhost -> interclient 1342 ms
-> firebirdsql 1193 ms
network -> interclient 470 ms
-> firebirdsql 20(!!!!) ms
Sample code:
FileInputStream fis = new FileInputStream(picture);//picture is a
File object...
Connection conn = DriverManager.getConnection(...);
PreparedStatement pstmt = conn.prepareStatement("insert into pics
(id_ref,pic_obj) values (?,?)");
pstmt.setLong(1,2);
pstmt.setBinaryStream(2,fis,fis.available());
long s = System.currentTimeMillis();
pstmt.executeUpdate();
pstmt.close();
conn.commit();
long e = System.currentTimeMillis();
System.out.println("Time needed: "+(e-s));
I couldn't find any lack of performance in neither in interclient nor
in firebirdsql.
As you can see I don't use the Borland's components: I simply use the
JDBC api.
Ciao
Luca