TECHNOLOGY: Oracle Exadata
Simulation Demonstrates PerformanceBy Arup Nanda
Use Oracle Exadata simulation in SQL Performance Analyzer to help predict how your application will perform on Oracle Exadata.
The newest disrupter in the database market is Oracle Exadata, which improves the performance of any type of application. But for those considering the move to Oracle Exadata, the big question is probably how your existing applications—running on a traditional database—will perform on Oracle Exadata. How can you know the answer before you actually take the leap to Oracle Exadata? In Oracle Database 11g Release 2, there is a new addition that allows you to simulate and measure the activities of your database under Oracle Exadata without actually investing in an Oracle Exadata appliance. In this article, I will show you how to use this capability to predict the performance you can expect for your applications running on Oracle Exadata.
Basis for Simulation
Oracle Database 11g Release 1 introduced a new tool—SQL Performance Analyzer—as a part of the Oracle Real Application Testing suite (see my Oracle Magazine March/April 2008 article “Performing Through Changes"). This tool allows you to capture SQL statements from any database and replay them in a new environment to uncover potential issues and predict behavior in the new target environment.
The target environment may be structurally different from the current production environment, with more or fewer indexes and materialized views, using different infrastructures, or running under different session parameters. In Oracle Database 11g Release 2, the scope of SQL Performance Analyzer is extended to simulate the functionality of Oracle Exadata.
Where’s the Performance?
Of the many ingredients in the secret sauce that makes Oracle Exadata so fast, it’s the intelligence in the storage cells—where the Oracle Exadata storage is located—that has the largest impact. The storage cells know the pattern of the data they store, so they can intelligently return only relevant data, rather than all data. Here is a simple query that illustrates the point:
select sum(order_qty) from sales where cust_id = 1000
In a traditional Oracle database, the server process issues the command to retrieve all blocks from the SALES table to the buffer cache (located in the system global area), if they are not there already. Then the session sifts through the accumulated data to identify rows where CUST_ID = 1000. Those rows are copied to the program global area of the server process, the sum of another column—ORDER_QTY—is computed, and, finally, the result is returned to the user. The table could potentially have 1 billion rows, and the number of rows where CUST_ID = 1000 could be just 100, so the database has to get all 1 billion rows to sort through them to find the matching rows. The I/O subsystem will still need to return all the blocks of the table to the server process. The storage in this case does not know the underlying data structure, so it can’t differentiate relevant data from the rest.
In an Oracle Real Application Clusters (Oracle RAC) system, there is yet another issue. Parallel query slaves could be spun off on multiple instances. They send the data they gather to the query coordinator in a different instance for collation over the inter-connect, saturating the interconnect hardware with this traffic. In addition, the process of transferring blocks over the interconnect also consumes CPU and requires latches, which in turn requires further CPU cycles. Therefore, the greater the demand for blocks from the storage system, the greater the load on CPU and I/O and the interconnect bandwidth—and the worse the query performance.
This is exactly where Oracle Exadata works its wonders—it knows the general distribution of data in table columns at the storage cells. When the aforementioned query is issued, the storage cells do not just return all the data from the table—they filter data at the storage level. The server process does not get all the blocks, but rather only those blocks that could potentially satisfy the condition, and then computes the sum from the relevant rows from those blocks. The demand on the storage is reduced from 1 billion rows—the total number of rows in the table—to just 100—the number of rows where CUST_ID = 1000. The I/O waits are reduced, enabling the storage subsystem to service more clients without putting them in queues. But the reduced load on storage is not the only Oracle Exadata benefit: the reduced number of buffers in the buffer cache means less contention for latches and subsequently less CPU consumption as well. In a typically busy system, Oracle Exadata could deliver several orders of magnitude difference in performance for this query and data.
Now that you know how Oracle Exadata speeds up the queries, the next natural question may be, does it work for your application? If your application does a lot of reads, then it exerts pressure on the storage and pushes a lot of buffers through the cluster interconnect. Oracle Exadata will reduce that pressure with significantly fewer reads (because the storage returns fewer blocks to the database nodes), so you can expect a dramatic performance difference. On the other hand, an application that does few reads may see a lesser performance gain. Instead of guessing about your application’s performance change following a move to Oracle Exadata, you can use Oracle Exadata simulation in SQL Performance Analyzer to help you predict performance gains. Note that in this initial offering, only a data warehouse decision-support system workload is simulated.
Simulating Oracle Exadata
You can perform the Oracle Exadata simulation in SQL Performance Analyzer in two ways—using Oracle Enterprise Manager and using APIs provided with Oracle Database. I am going to show the process using APIs. (For steps on using Oracle Enterprise Manager, see the Oracle By Example tutorial.) Here are the steps:
Figure 1 shows a partial output from the report that compares the execution statistics. The report clearly shows the predicted impact of Oracle Exadata on I/O interconnect bytes. In the first run—with Oracle Exadata simulation disabled—the number of bytes was 25,174,016. In the second run—with Oracle Exadata simulation enabled—the number of bytes was only 2,763,712, or about a tenth of the bytes in the first run—a significant improvement by any count.
This means that on Oracle Exadata, the I/O across the interconnect will be about a tenth of the original value, reducing the bandwidth utilization and resultant CPU usage as well as the number of blocks processed by the global cache mechanism. So the query, with no changes, will likely perform orders of magnitude better on Oracle Exadata.
Similarly, had you seen an improvement in the range of 10 percent in the Exadata simulated workload, then you could surmise that those SQL statements likely would not perform dramatically better in Oracle Exadata. In that case, the most dramatic event would be that you were able to predict the execution improvement reasonably well without actually executing the statements on an Oracle Exadata Database Machine.
The full report (not shown in Figure 1) also shows the execution plan of the queries before and after the Oracle Exadata cell simulation. Migration to Oracle Exadata may not change the query plan, but some execution steps will change to reflect the cell processing that is not available on a regular storage. For example, a TABLE ACCESS FULL execution step in the non-Exadata simulation will become TABLE ACCESS STORAGE FULL under Oracle Exadata and is shown as such in the after-simulation plan. But with that exception, the plan will not change because all the other factors—optimizer environment, session parameters, RDBMS version, and so on—are identical in both simulation runs.
As shown in Listing 8, the last parameter in the call to dbms_spa.report_analysis_task is ALL, which indicates that the report will include details on the individual SQL statements. This helps to present the performance benefit of Oracle Exadata in even greater detail, because not only can you see the overall improvement, but you will be able to see the impact of Exadata simulation on individual statements—some of which may be business critical or are executed much more often in the production environment. The I/O savings in those cases will be highly visible in the report and very valuable to your production operations—a fact that you may want to highlight in the business case for Oracle Exadata.
One of the key ingredients of the superior performance of the Oracle Exadata appliance is the ability of the storage to return only the relevant data blocks—not the entire table. This minimizes the I/O at the database servers and results in less I/O across the interconnect and fewer CPU cycles. But if you want to predict how much I/O is saved on specific SQL statements from your actual production database, you can perform the Oracle Exadata simulation on any Oracle Database 11g Release 2 database with traditional storage and get a fairly accurate estimate of the I/O savings in Oracle Exadata.
Arup Nanda (email@example.com) has been an Oracle DBA for more than 14 years, handling all aspects of database administration. He was Oracle Magazine’s DBA of the Year in 2003.
Send us your comments