Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Benchmarks of MySQL, MaxDB, PostgreSQL, and Oracle



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=1923&S=aeac79693ab902121ccb13957fb65d8c&t=msg&th=5893&start=0&logoff=1

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 = null;
    try {
      //MYSQL4.1
      conn = java.sql.DriverManager.getConnection(
          "[url]jdbc:mysql://localhost:3333/test[/url]");
      test("MySQL4", conn);
      //MYSQL5
       conn =
       java.sql.DriverManager.getConnection("[url]jdbc:mysql://localhost/test[/url]");
      test("MySQL5", conn);

      //MAXDB
      conn = java.sql.DriverManager.getConnection(
          "[url]jdbc:sapdb://LOCALHOST/TEST?unicode=true[/url]",
          "USERTEST", "USERTEST");
      test("MAXDB", conn);

      // postgresql
      conn = java.sql.DriverManager.getConnection(
          "[url]jdbc:postgresql://localhost:5432/testdb[/url]", "user",
          "1234");
      test("POSTGRESQL", conn);
      //ORACLE
      conn = 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 = 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 = 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 = conn.prepareStatement(
          "insert into dm(id,mc) values(?,?)");
      for (int i = 0; i < 10000; i++) {
        pst.setInt(1, i);
        pst.setString(2, "benchmark test");
        pst.execute();
      }
      conn.rollback();
      java.util.Date d_last = new java.util.Date();
      System.out.print(db);
      System.out.print(" now END:");
      
      System.out.println(d_last.getTime());
      System.out.print(db);
      System.out.print(" Use Time :");
      System.out.println(d_last.getTime() - d_first.getTime());

    }finally
    {
      conn.close();
    }
  }

The result follows (figures are in seconds):

MySQL4 Use Time :13484
MySQL5 Use Time :9703
MAXDB Use Time :10641
POSTGRESQL Use Time :11547
ORACLE Use Time :11140

Replacing ROLLBACK with COMMIT in the testing script he got the
following result:

MySQL4 Use Time :14031
MySQL5 Use Time :9937
MAXDB Use Time :10985
POSTGRESQL Use Time :12860
------------



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group