X-Original-To: pgsql-benchmarks-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 71CA152955 for ; Thu, 24 Mar 2005 10:35:19 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 60985-03 for ; Thu, 24 Mar 2005 10:35:09 +0000 (GMT) Received: from out1.smtp.messagingengine.com (out1.smtp.messagingengine.com [66.111.4.25]) by svr1.postgresql.org (Postfix) with ESMTP id 4C33153224 for ; Thu, 24 Mar 2005 10:35:08 +0000 (GMT) Received: from web2.messagingengine.com (web2.internal [10.202.2.211]) by frontend1.messagingengine.com (Postfix) with ESMTP id DCB56C63C41 for ; Thu, 24 Mar 2005 05:35:10 -0500 (EST) Received: by web2.messagingengine.com (Postfix, from userid 99) id 3849534EE; Thu, 24 Mar 2005 05:35:08 -0500 (EST) Message-Id: <1111660508.23316.230311438@webmail.messagingengine.com> X-Sasl-Enc: kP20FCtmDoIqWNxJTAU9I6IBqX+o247YQh5ukU3iaefV 1111660508 From: "CN" To: pgsql-benchmarks@postgresql.org Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="Big5" MIME-Version: 1.0 X-Mailer: MIME::Lite 1.5 (F2.73; T1.001; A1.64; B3.05; Q3.03) Subject: Benchmarks of MySQL, MaxDB, PostgreSQL, and Oracle Date: Thu, 24 Mar 2005 18:35:08 +0800 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.152 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/3 X-Sequence-Number: 41 Hi! A person compared the performances of MySQL, MaxDB, PostgreSQL, and Oracle, and posted his result at http://laser.dyndns.pgsqldb.com/index.php?rid=3D1923&S=3Daeac79693ab902121c= cb13957fb65d8c&t=3Dmsg&th=3D5893&start=3D0&logoff=3D1 I excerpted his JBuilder benchmark testing script and the results as follows. Peronally I am not satisfied with PostgreSQL's position in the result, which shows that PostgreSQL is only faster than MySQL4.1. Can anyone give some comments on this? Should we ignore all of them? Regards, CN ------------ Tested platform: WinXP SP1 public void testInsert() { java.sql.Connection conn =3D null; try { //MYSQL4.1 conn =3D java.sql.DriverManager.getConnection( "[url]jdbc:mysql://localhost:3333/test[/url]"); test("MySQL4", conn); //MYSQL5 conn =3D java.sql.DriverManager.getConnection("[url]jdbc:mysql://localhost/te= st[/url]"); test("MySQL5", conn); //MAXDB conn =3D java.sql.DriverManager.getConnection( "[url]jdbc:sapdb://LOCALHOST/TEST?unicode=3Dtrue[/url]", "USERTEST", "USERTEST"); test("MAXDB", conn); // postgresql conn =3D java.sql.DriverManager.getConnection( "[url]jdbc:postgresql://localhost:5432/testdb[/url]", "user", "1234"); test("POSTGRESQL", conn); //ORACLE conn =3D java.sql.DriverManager.getConnection( "jdbc:oracle:thin:@127.0.0.1:1521:mydb", "ssdb", "ssdb"); test("ORACLE", conn); } catch (Exception e) { e.printStackTrace(); } } public void test(String db,java.sql.Connection conn) throws Exception { try { java.sql.Statement st =3D conn.createStatement(); try { try { st.executeUpdate("drop table dm"); }catch(Exception e) { ; } st.execute("Create Table dm(id integer,mc varchar(40))"); } finally { st.close(); } java.util.Date d_first =3D new java.util.Date(); System.out.println(""); System.out.print(db); System.out.print(" now will start :"); System.out.println(d_first.getTime()); conn.setAutoCommit(false); java.sql.PreparedStatement pst =3D conn.prepareStatement( "insert into dm(id,mc) values(?,?)"); for (int i =3D 0; i < 10000; i++) { pst.setInt(1, i); pst.setString(2, "benchmark test"); pst.execute(); } conn.rollback(); java.util.Date d_last =3D new java.util.Date(); System.out.print(db); System.out.print(" now END:"); =20=20=20=20=20=20 System.out.println(d_last.getTime()); System.out.print(db); System.out.print(" Use Time =A1G"); System.out.println(d_last.getTime() - d_first.getTime()); }finally { conn.close(); } } The result follows (figures are in seconds): MySQL4 Use Time =A1G13484 MySQL5 Use Time =A1G9703 MAXDB Use Time =A1G10641 POSTGRESQL Use Time =A1G11547 ORACLE Use Time =A1G11140 Replacing ROLLBACK with COMMIT in the testing script he got the following result: MySQL4 Use Time =A1G14031 MySQL5 Use Time =A1G9937 MAXDB Use Time =A1G10985 POSTGRESQL Use Time =A1G12860 ------------