1
Oracle Database 12c Preview In-Memory Column Store (V12.1.0.2) Michael Künzner Principal Sales Consultant
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle's products remains at the sole discretion of Oracle. 3
Oracle Database In-Memory Option Goals Real-Time Ad-hoc Analytics on Live Transactional Data Ask any business question Get an instant response Using current data While Also Accelerating OLTP Trivial to Deploy for All Applications and Customers 4
Oracle In-Memory Design Goals Target Specification Integration in existing Infrastructure High Availability Backup & Recovery and Desaster Recovery Applications should profit without any change Transparent Usage SQL & Optimizer aware OLTP & Analytics No Data Migration Ease of Use Simple Definition through SQL OLTP Analytics Memory Row Format Memor y Column Format 5
Decades Long Controversy Row Format or Column Format Row OLTP runs best on row format Operates on few rows, many columns Column Analytics runs best on column format Operates on few columns, many rows Until Now You Choose One Format and Suffer Tradeoffs 6
Row Store vs. Column Store OLTP-style query SELECT * FROM salesorders WHERE document_number = 95779216 OLAP-style query SELECT sum(value) FROM salesorders WHERE document_date > 2013-08-28 7
Oracle Database In-Memory Option Leading edge In-Memory technology Seamlessly integrated into Oracle Database Delivers Extreme Performance for Analytics and Ad-Hoc reporting on live data Enterprise OLTP and Data Warehousing Scale-up and Scale-out Trivial to Deploy for All Applications and Customers 8
Breakthrough: Dual Format In-Memory Database Memory Memory BOTH row and column in-memory formats for same table Simultaneously active and transactionally consistent OLTP Sales Row Format Sales Column Format Analytics Analytics & reporting use New Column format OLTP uses row format 9
Oracle In-Memory Columnar Technology Pure in-memory format with no logging Near zero overhead on changes even for OLTP DRAM Pure Columnar Data loaded in-memory for active tables or partitions On startup or first access 10
Vector Register Find Any Business Data in Sub-second Example: Find all sales in state of CA Each CPU scans local in-memory columns Scans use super fast SIMD vector instructions In-Memory Column Store Sales State column >100X Faster Billions of rows/sec scan rate per CPU core CPU Load multiple State values CA SIMD Vector Compare all Compare values in 1 all values cycle in 1 cycle 11
Combine Data in Sub-Second to Find Answers Example: Find all sales in outlet stores Converts join processing into fast column scans Joins up to 10x faster T Y P E Stores Storeid in 15,38,64 S T O R E I D Sales A M O U N T Type=outlet Sum 12
Generate Reports In Sub-second Dynamically creates in-memory report outline Report contents populated during fact scan Example: Show sales trends for footwear products in outlet stores Stores In-Memory Report Outline Sales Reports up to 20x faster without predefined cubes Products Sales 13
OLTP is Slowed Down by Analytic Indexes Most Indexes in mixed-use OLTP (e.g. ERP) databases are only used for analytics Table 1 to 3 OLTP Indexes 5 to 15 Analytics Indexes Work well for known access patterns both in-memory and on-disk But maintaining analytic indexes slows all data changes 14
Both Analytics and Extreme Performance OLTP In-Memory Column Store replaces analytic indexes and removes their overhead for tables that fit in memory Table 1 to 3 OLTP Indexes In-Memory Column Store Both predefined and ad-hoc analytic queries run fast OLTP & batch run up to 300% faster Less tuning & admin 15
Extreme Capacity and Cost Effectiveness Size not limited by memory Data transparently moves between tiers Each tier has specialized algorithms & compression DRAM PCI FLASH Capacity of Disk IOs of Flash Speed of DRAM DISK Hottest Data Active Data Cold Data 16
Scale-Out In-Memory Database to Any Size Scale-Out across servers to grow memory and CPUs In Memory Column Store In Memory Column Store In-Memory queries are parallelized across servers to access local column data In Memory Column Store In Memory Column Store Direct-to-wire InfiniBand protocol speeds messaging 17
Scale-Up for Optimal In-Memory Processing Scale-Up on large SMPs SMP scaling removes overhead of distributing queries across servers or coordinating transactions Inter-processor bandwidth far exceeds any network 18
Using the In-Memory Column Store for Tables The In-Memory Column Store divides table rows into large memory regions Within a region, a column resides separately in a contiguous area Both memory areas can store the same data in different storage formats The In-Memory Column Store does not replace the buffer cache, but acts as a supplement You can enable the In-Memory Column Store at any of the following levels tablespace, table, partition, and column 19
Oracle In-Memory is Trivial to Deploy 1. Configure Memory Capacity ALTER SYSTEM SET inmemory_columnar_size=1g; 2. Configure tables or partitions to be in memory ALTER TABLE PARTITION INMEMORY; 3. Later Drop most analytic indexes 20
Configuring the In-Memory Column Store SQL> SHOW PARAMETER inmemory NAME TYPE VALUE -------------------------- ------------ ------------------- inmemory_columnar_size big integer 0 SQL> ALTER SYSTEM SET inmemory_columnar_size=1g SCOPE=both; System altered. SQL> SHOW PARAMETER inmemory NAME TYPE VALUE -------------------------- ------------ ------------------- inmemory_columnar_size big integer 1G 21
Storing Tablespaces in the In-Memory Column Store SQL> CREATE TABLESPACE tbs1 DATAFILE 'tbs1.dbf' SIZE 40M ONLINE DEFAULT INMEMORY; SQL> ALTER TABLESPACE tbs1 DEFAULT INMEMORY MEMCOMPRESS FOR CAPACITY HIGH PRIORITY LOW; 22
Using the In-Memory Column Store for Tables Tables in the In-Memory Column Store can improve performance significantly for the following types of operations A query that scans a large number of rows and applies filters that use operators like =, <, >, and IN A query that selects a small number of columns from a table with a large number of columns, for example five columns from a table with 100 columns A query that joins a small table to a large table A query that aggregates data 23
Using the In-Memory Column Store for Tables The In-Memory Column Store does not improve performance for the following types of operations Queries with complex predicates Queries that select a large number of columns Queries that return a large number of rows Queries with multiple large table joins 24
Using the In-Memory Column Store for Tables To determine which database objects are stored in the In-Memory Column Store, run the following query SQL> SELECT o.owner, o.object_name FROM v$imc_segments v, all_objects o WHERE v.dataobj = o.data_object_id; SQL> ALTER TABLE oe.product_information INMEMORY MEMCOMPRESS FOR QUERY PRIORITY HIGH (product_id, product_name, category_id, supplier_id, min_price) MEMCOMPRESS FOR CAPACITY HIGH PRIORITY LOW (product_description, warranty_period, product_status, list_price) NO INMEMORY (weight_class, catalog_url); 25
In-Memory Compression Methods In-Memory Compression Method CREATE/ALTER TABLE Syntax Description Basic MEMCOMPRESS BASIC This method does not compress the table data Throughput MEMCOMPRESS FOR QUERY This method results in the best query performance This method compresses in-memory table data the least (except for MEMCOMPRESS BASIC) This method is the default when the INMEMORY clause is specified without a compression method in a CREATE TABLE or ALTER TABLE statement Balanced MEMCOMPRESS FOR CAPACITY LOW This method results in excellent query performance. This method compresses in-memory table data more than MEMCOMPRESS FOR QUERY but less than MEMCOMPRESS FOR CAPACITY HIGH. This method is the default when MEMCOMPRESS FOR CAPACITY is specified without including either LOW or HIGH Space MEMCOMPRESS FOR CAPACITY HIGH This method results in good query performance This method compresses in-memory table data the most 26
In-Memory Data Loading Options Priority Level CREATE/ALTER TABLE Syntax Description None PRIORITY NONE Oracle Database controls when the table data is loaded into the In-Memory Column Store. Loading of the table's data might be delayed if the memory required for the data is needed for other tasks. Also, Oracle Database might load some table columns but not others into the In-Memory Column Store This is the default level when PRIORITY is not included in the INMEMORY clause Low PRIORITY LOW The table's data is loaded into the In-Memory Column store before tables with the following priority level: NONE The table's data is loaded into the In-Memory Column store after tables with the following priority levels: MEDIUM, HIGH, or CRITICAL Medium PRIORITY MEDIUM The table's data is loaded into the In-Memory Column store before tables with the following priority levels: NONE or LOW The table's data is loaded into the In-Memory Column store after tables with the following priority levels: HIGH or CRITICAL High PRIORITY HIGH The table's data is loaded into the In-Memory Column store before tables with the following priority levels: NONE, LOW, or MEDIUM The table's data is loaded into the In-Memory Column store after tables with the following priority level: CRITICAL Critical PRIORITY CRITICAL The table's data is loaded into the In-Memory Column store before tables with the following priority levels: NONE, LOW, MEDIUM, or HIGH 27
Oracle In-Memory is Transparent to Applications Full Functionality - No restrictions on SQL Trivial to Implement - No migration of data or change of product Fully Compatible - All existing applications run unchanged DB as a Service Ready - Oracle Multitenant in-memory Uniquely Achieves All In-Memory Benefits With No Application Changes 28
Oracle In-Memory Delivers Extreme Availability Pure In-Memory format does not change Oracle s storage format, logging, backup, recovery, etc. All Oracle s mature availability technologies work transparently Protection from all failures Node, site, corruption, human error, change, etc. Data Guard & GoldenGate RAC ASM RMAN 29
Oracle In-Memory Summary Extreme Performance Analytics & OLTP on live OLTP data Extreme Tiering, Scale-Out & Scale-Up Extreme Scale-Up on M6 Big Memory Machine Extreme Availability All In-Memory Benefits With No Application Changes 30
31
Graphic Section Divider 32
33
34