MemOptimized RowStore in Oracle Database 18c with OCI

On June, 10 2018 I blogged about the MemOptimized RowStore in Oracle Database 18c. If you haven’t read this post, it is a good idea to catch up now. I showed that accessing a memoptimized table t4 via the MemOptimized RowStore was around 60% slower than accessing a heap-organized table t1. I suspected that this disappointing result was related to my unsupported Docker environment. But I was wrong.

The next day, Chris Antognini contacted me, since he planned to talk about this feature at the AOUG Anwenderkonferenz 2018. We exchanged our thoughts and shared our findings. Chris did his tests in the Oracle cloud and could also reproduce my test results. That’s interesting. Even more interesting is, that Chris translated my Java program to C and proved that the MemOptimized RowStore can be fast. That’s cool. But why didn’t it work in Java? It’s the same after all, right? No. The Java program used the JDBC thin driver and the C program OCI.

In this blog post I will show that OCI is a prerequisite for getting good performance out of the MemOptimized RowStore.

The Program

I use the Java program from my previous post. I only added 3 parameters. The JDBC URL, the username and the password. Here’s the program.

I copied this program to my Docker container into the directory $ORACLE_HOME/jdbc/lib and compiled it with the following script:

The Test Script

I’ve run the tests for my previous post from the Eclipse IDE because it was convenient for me to set a break point on line 20 to identify the Oracle process for perf. Now, I do not need to produce flame graphs. Running the test script on the server directly will also reduce the network overhead, especially when running without Oracle Net.

Here’s the test script:

The Result

Here’s the output of the run.sh call:

As in my previous post, I ignore the slowest and fastest run and take the average of the remaining three results per test variant to produce a chart.

We see that using the JDBC OCI driver delivers the fastest results when skipping Oracle Net. Furthermore, the MemOptimized RowStore delivers the fastest results via OCI. Accessing the MemOptimized RowStore via the JDBC thin driver leads by to a bad performance. This looks like a bug.

Conclusion

To get benefit from the MemOptimized RowStore you have to access the database via OCI.

1 Comment

  1. […] You have to use OCI, otherwise the performance will be really bad, see succeeding blog post MemOptimized RowStore in Oracle Database 18c with OCI. This might be a bug. [added on […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.