viernes, 25 de mayo de 2012

SAP HANA vs. MySQL - Small test

So...today I wanted to do a little measure between SAP HANA and MySQL execution of Insert statements.

For this, I create a small Python script to prevent myself from copy & paste trauma.

import os
import sys


def Generate_File(pNumber):
    iNumber = 0
    pathname = os.path.dirname(sys.argv[0])
    pathname = os.path.abspath(pathname) + "\HANA_File.txt"
    myfile = open(pathname, "a")
    while iNumber < pNumber:
        iNumber += 1
        myfile.write("insert into HANA_File values (" + str(iNumber) + 
        ",'Test Line');\n")
    myfile.close()
    print 'The file ' + pathname + ' was written successfully'

Generate_File(1000)

When run, this small program will generate 1000 records.

And the table structure for both SAP HANA and MySQL would as simple as:

Id --> Integer
Text --> Varchar(10)

Let's start with MySQL...




MySQL doesn't give us the total amount of time spend, but we can assume about 3 minutes...

Let's move to SAP HANA...



SAP HANA gives us the total amount of time spend, which was 1:18.484 minutes

So we can deduct that SAP HANA was 60% faster than MySQL...and for sure, that's not the best way to load records on SAP HANA...but even like this, you can see how fast SAP HANA really is...

Greetings,

Blag.

4 comentarios:

Anónimo dijo...

Hello Blag. It would be interesting if you could add one additional step plus one additional variance to your test:
1. You need to add to load into HANA db: UPDATE «table» MERGE DELTA INDEX;
2. Have a variance where the second column has unique value in each record of the second column.
Thanks,
-Vitaliy

Anónimo dijo...

i think that if you retry this test using PostgreSQL you could have another surprises ;)

Anónimo dijo...

i think that if you retry this test using PostgreSQL you could have another surprises ;)

Alvaro "Blag" Tejada Galindo dijo...

Vitaliy and However else wrote a comment:

I will publish tomorrow a new post with your suggestions -;)

Greetings,

Blag.