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

Benchmarks of MySQL, MaxDB, PostgreSQL, and Oracle

From: "CN" <cnliou9(at)fastmail(dot)fm>
To: pgsql-benchmarks(at)postgresql(dot)org
Subject: Benchmarks of MySQL, MaxDB, PostgreSQL, and Oracle
Date: 2005-03-24 10:35:08
Message-ID: 1111660508.23316.230311438@webmail.messagingengine.com (view raw or flat)
Thread:
Lists: pgsql-benchmarks
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
------------

Responses

pgsql-benchmarks by date

Next:From: Achilleus MantziosDate: 2005-03-24 11:45:09
Subject: Re: Benchmarks of MySQL, MaxDB, PostgreSQL, and
Previous:From: Richard HuxtonDate: 2005-03-11 13:05:28
Subject: Re: [GENERAL] more execution time

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group