pg.ddx.io  pgsql-benchmarks@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: CN <cnliou9@fastmail.fm>
To: pgsql-benchmarks@postgresql.org
Subject: Benchmarks of MySQL, MaxDB, PostgreSQL, and Oracle
Date: Thu, 24 Mar 2005 18:35:08 +0800
Message-ID: <1111660508.23316.230311438@webmail.messagingengine.com> (raw)

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&...

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 ¡G");
      System.out.println(d_last.getTime() - d_first.getTime());

    }finally
    {
      conn.close();
    }
  }

The result follows (figures are in seconds):

MySQL4 Use Time ¡G13484
MySQL5 Use Time ¡G9703
MAXDB Use Time ¡G10641
POSTGRESQL Use Time ¡G11547
ORACLE Use Time ¡G11140

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

MySQL4 Use Time ¡G14031
MySQL5 Use Time ¡G9937
MAXDB Use Time ¡G10985
POSTGRESQL Use Time ¡G12860
------------



view thread (3+ messages)  latest in thread

Message-ID: <1111660508.23316.230311438@webmail.messagingengine.com>
Permalink:  ../1111660508.23316.230311438@webmail.messagingengine.com/
Also on:    postgresql.org/message-id/1111660508.23316.230311438@webmail.messagingengine.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-benchmarks@postgresql.org
  Cc: cnliou9@fastmail.fm
  Subject: Re: Benchmarks of MySQL, MaxDB, PostgreSQL, and Oracle
  In-Reply-To: <1111660508.23316.230311438@webmail.messagingengine.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox