Who am I? Copyright 2014, Oracle and/or its affiliates. All rights reserved. 3



Similar documents
Safe Harbor Statement

Oracle InMemory Database

Oracle Database In-Memory The Next Big Thing

Oracle Database In- Memory & Rest of the Database Performance Features

An Oracle White Paper July Oracle Database In-Memory

Preview of Oracle Database 12c In-Memory Option. Copyright 2013, Oracle and/or its affiliates. All rights reserved.

Under The Hood. Tirthankar Lahiri Vice President Data Technologies and TimesTen October 28, #DBIM12c

Oracle MulBtenant Customer Success Stories

When to Use Oracle Database In-Memory

Oracle Database In-Memory A Practical Solution

Oracle s In-Memory Database Strategy for OLTP and Analytics

Query Optimization in Oracle 12c Database In-Memory

ORACLE DATABASE 12C IN-MEMORY OPTION

Optimize Oracle Business Intelligence Analytics with Oracle 12c In-Memory Database Option

Oracle Database In-Memory: A Dual Format In-Memory Database

Distributed Architecture of Oracle Database In-memory

Query Acceleration of Oracle Database 12c In-Memory using Software on Chip Technology with Fujitsu M10 SPARC Servers

Oracle Big Data, In-memory, and Exadata - One Database Engine to Rule Them All Dr.-Ing. Holger Friedrich

Inge Os Sales Consulting Manager Oracle Norway

Integrating Apache Spark with an Enterprise Data Warehouse

<Insert Picture Here> Best Practices for Extreme Performance with Data Warehousing on Oracle Database

Oracle Database In-Memory

2009 Oracle Corporation 1

Safe Harbor Statement

1Z0-117 Oracle Database 11g Release 2: SQL Tuning. Oracle

An Oracle White Paper February, Oracle Database In-Memory Advisor Best Practices

Oracle EXAM - 1Z Oracle Database 11g Release 2: SQL Tuning. Buy Full Product.

Exadata for Oracle DBAs. Longtime Oracle DBA

Expert Oracle Exadata

Automatic Data Optimization

SAP HANA PLATFORM Top Ten Questions for Choosing In-Memory Databases. Start Here

Tips and Tricks for Using Oracle TimesTen In-Memory Database in the Application Tier

Upcoming: Oracle Database 12.1 Support Update for Linux on System z

ENHANCEMENTS TO SQL SERVER COLUMN STORES. Anuhya Mallempati #

Oracle Database 11g: New Features for Administrators DBA Release 2

low-level storage structures e.g. partitions underpinning the warehouse logical table structures

Oracle Database In- Memory Op4on in Ac4on

Overview: X5 Generation Database Machines

Oracle 11g New Features - OCP Upgrade Exam

An Oracle White Paper November Hybrid Columnar Compression (HCC) on Exadata

Oracle Database 11 g Performance Tuning. Recipes. Sam R. Alapati Darl Kuhn Bill Padfield. Apress*

SAP HANA - Main Memory Technology: A Challenge for Development of Business Applications. Jürgen Primsch, SAP AG July 2011

Application-Tier In-Memory Analytics Best Practices and Use Cases

Oracle Database 12c: Performance Management and Tuning NEW

IBM Data Retrieval Technologies: RDBMS, BLU, IBM Netezza, and Hadoop

<Insert Picture Here> Oracle Database Directions Fred Louis Principal Sales Consultant Ohio Valley Region

Oracle Database 10g: New Features for Administrators

Objectif. Participant. Prérequis. Pédagogie. Oracle Database 11g - New Features for Administrators Release 2. 5 Jours [35 Heures]

Oracle DBA Course Contents

Oracle Exadata: The World s Fastest Database Machine Exadata Database Machine Architecture

OLTP Meets Bigdata, Challenges, Options, and Future Saibabu Devabhaktuni

Oracle Database - Engineered for Innovation. Sedat Zencirci Teknoloji Satış Danışmanlığı Direktörü Türkiye ve Orta Asya

Oracle Architecture, Concepts & Facilities

Oracle - Engineered for Innovation. Thomas Kyte

CitusDB Architecture for Real-Time Big Data

Distributed Architecture of Oracle Database In-memory

Oracle Database 12c Plug In. Switch On. Get SMART.

Oracle Enterprise Manager 12c New Capabilities for the DBA. Charlie Garry, Director, Product Management Oracle Server Technologies

1. This lesson introduces the Performance Tuning course objectives and agenda

Columnstore in SQL Server 2016

Oracle Database 11g: SQL Tuning Workshop

An Oracle White Paper August Automatic Data Optimization with Oracle Database 12c

<Insert Picture Here> Oracle Exadata Database Machine Overview

Tuning Exadata. But Why?

<Insert Picture Here>

An Oracle White Paper May Exadata Smart Flash Cache and the Oracle Exadata Database Machine

Bloom Filters. Christian Antognini Trivadis AG Zürich, Switzerland

Introduction to Database as a Service

In-Memory Data Management for Enterprise Applications

Oracle Database 11g: Performance Tuning DBA Release 2

News and trends in Data Warehouse Automation, Big Data and BI. Johan Hendrickx & Dirk Vermeiren

Actian Vector in Hadoop

Petabyte Scale Data at Facebook. Dhruba Borthakur, Engineer at Facebook, SIGMOD, New York, June 2013

Performance Verbesserung von SAP BW mit SQL Server Columnstore

<Insert Picture Here> Oracle In-Memory Database Cache Overview

Module 14: Scalability and High Availability

How To Build An Exadata Database Machine X2-8 Full Rack For A Large Database Server

Oracle Database 11g: SQL Tuning Workshop Release 2

Engineering Database Hardware and So2ware Together

ORACLE OLAP. Oracle OLAP is embedded in the Oracle Database kernel and runs in the same database process

Oracle Database 10g: Administration Workshop II Release 2

An Oracle White Paper June High Performance Connectors for Load and Access of Data from Hadoop to Oracle Database

DBA Best Practices: A Primer on Managing Oracle Databases. Leng Leng Tan Vice President, Systems and Applications Management

Applying traditional DBA skills to Oracle Exadata. Marc Fielding March 2013

SQL Server 2012 Performance White Paper

Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC

How To Use Exadata

Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Oracle Total Recall with Oracle Database 11g Release 2

The Sierra Clustered Database Engine, the technology at the heart of

Capacity Management for Oracle Database Machine Exadata v2

Oracle Database 11g: Administer a Data Warehouse

- An Oracle9i RAC Solution

<Insert Picture Here> Enhancing the Performance and Analytic Content of the Data Warehouse Using Oracle OLAP Option

Enhancing SQL Server Performance

Is there any alternative to Exadata X5? March 2015

An Oracle White Paper January Advanced Compression with Oracle Database 11g

SQL Performance for a Big Data 22 Billion row data warehouse

ORACLE DATABASE 12c FOR SAP: ROADMAP, BASE CERTIFICATION FEATURES AND OPTIONS

Contents at a Glance. Contents... v About the Authors... xiii About the Technical Reviewer... xiv Acknowledgments... xv

Transcription:

Oracle Database In-Memory Power the Real-Time Enterprise Saurabh K. Gupta Principal Technologist, Database Product Management

Who am I? Principal Technologist, Database Product Management at Oracle Author of Packt s Oracle Advanced PL/SQL Developer Professional Guide, Technical Reviewer Blog: www.sbhoracle.wordpress.com Social: @SAURABHKG Email: saurabh.h.gupta@oracle.com 3

Oracle Database 12c In-Memory Option Goals Orders of Magnitude Faster Analytics Real Time Queries on OLTP Database ordata Warehouse Faster Mixed Workload OLTP Simple: Transparent to applications and easy to deploy Cost-Effective: Not require entire database to be in-memory

AGENDA In-Memory Column Format Getting Started with the IM Column Store In-Memory Performance Optimizations In-Memory Advisor In-Memory Scale-Out 5

Row Format Databases vs. Column Format Databases Row SALES Transactions run faster on row format Example: Insert or query a sales order Fast processing few rows, many columns Column SALES Analytics run faster on column format Example : Report on sales totals by region Fast accessing few columns, many rows Until Now Must Choose One Format and Suffer Tradeoffs 6

Breakthrough: Dual Format Database Existing Buffer Cache SALES Row Format New In-Memory Format SALES Column Format BOTHrow and column formats for same table Simultaneously active and transactionally consistent OLTP uses proven row format Analytics & reporting use new in-memory Column format Same results regardless of which format is used 7

Dual-Format Database SALES SALES ID PROD STORE QTY AMOUNT 983 MILK SF 5 20 111 BREAD LA 20 45 695 APPLE SF 10 5 Row Store Rotate 90 ID 983 111 695 PROD MILK BREA D APPLE STORE SF LA SF QTY 5 20 10 AMOUNT 20 45 5 Column Store 8

Dual-Format Database Dual-Format does not double memory requirements In-Memory Store sized to accommodate objects that must be stored in memory Buffer cache is optimized (since decades) to run on much smaller size than the database However, expect to allocate more memory than previously allocated (typically 20% more) No additional disk storage cost Optimizer is fully aware of the dual formats Automatically routes analytical queries to column store and OLTP to row store 9

In-Memory A Store Not A Cache Buffer Cache A B C E A A C What is a cache? A pool of memory Data automatically brought into memory based on access Data automatically aged out Good example: Oracle Database Buffer Cache B

In-Memory A Store Not A Cache Pure In-Memory Columnar SALES What is a store? A static pool of memory You decide what objects are populated in memory Alter table SALES INMEMORY Objects don t age out Objects automatically kept transactionally consistent 11

Oracle In-Memory Columnar Format Pure In-Memory Columnar SALES Available on all platforms that the Oracle Database supports Pure in-memory column format Not persistence, and no logging In-memory maintenance: Allows fast OLTP No changes to disk format Enabled at tablespace, table, partition, subpartition level Can even be enabled for whole database 2x 20x Compression 12

In-Memory Area: New Area within SGA System Global Area SGA Buffer Cache Shared Pool Log Buffer Contains data in the new In-Memory Column Format Controlled by INMEMORY_SIZE parameter Large Pool Other In-Memory Area 13

In-Memory Area: Composition In Memory Area IMCU IMCU SMU SMU IMCU IMCU SMU SMU IMCU IMCU SMU SMU SMU SMU IMCU IMCU Column Format Data Metadata Contains two sub-pools: IMCU pool: Stores In Memory Compression Units (IMCUs) SMU pool: Stores Snapshot Metadata Units (SMUs) IMCUs contain column formatted data SMUs contain metadata and transactional information Current pool sizes and status visible in V$INMEMORY_AREA view 14

In-Memory Compression Unit (IMCU) ROWID EMPID IMCU header Column CUs NAME DEPT SALARY Unit of column store allocation Columnar representation of a large number of rows (e.g. 0.5 million) Rows in one or more table extents Actual size depends on size of rows, compression factor, etc. Memory Disk Extent #13 Blocks 20-120 Extent #14 Blocks 82-182 Extent #15 Blocks 201-301 Each column stored as a separate contiguous ColumnCompression Unit (column CU) Rowidsalso stored as a Column CU 15

AGENDA In-Memory Column Format Getting Started with the IM Column Store In-Memory Performance Optimizations In-Memory Advisor In-Memory Scale-Out 17

Getting Started with the IM Column Store Plan uses IM Column Store (Object in- Memory) Buffer Cache 1. Set init.ora parameter INMEMORY_SIZE In-Memory Column Store 2. Enable Objects for IM Population Optimizer Plan uses Buffer Cache/ Disk (Object NOT In-Memory) CREATE or ALTER <table> INMEMORY 4. Query DBWR IMCO SMCO W000 W001 3. Populate Objects (Manual or Automatic) Row Format 18

In-Memory Column Store Populate: Enabling ALTER TABLE sales INMEMORY; ALTER TABLE revenue NO INMEMORY; CREATE TABLE customers PARTITION BY LIST (PARTITION p1 INMEMORY, (PARTITION p2 NO INMEMORY); ALTER TABLE accounts INMEMORY NO INMEMORY (photo); Selectively enable in-memory storage New INMEMORY clause Eligible: Tables, Partitions, Sub-Partitions, Materialized Views Ineligible: IOTs, Hash clusters (pure OLTP features) Can also exclude unneeded columns 19

In-Memory Column Store Populate: Prioritizing CREATE TABLE orders (c1 number, c2 varchar(20), c3 number) INMEMORY PRIORITY CRITICAL; ALTER TABLE sales INMEMORY PRIORITY MEDIUM; ALTER TABLE accounts INMEMORY PRIORITY NONE; PRIORITY sub-clause enables pre-populate On startup, create, alter Levels: CRITICAL > HIGH > MEDIUM > LOW Controls order (not speed) of populate Default PRIORITY is NONE Populate only on first access 20

In-Memory Column Store Populate: Compression ALTER MATERIALIZED VIEW mv1 INMEMORY MEMCOMPRESS FOR QUERY; CREATE TABLE trades (Name varchar(20), Desc varchar(200)) INMEMORY MEMCOMPRESS FOR DML(desc); Objects compressed during population New compression techniques Focused on scan performance Controlled by MEMCOMPRESS subclause Multiple levels of compression Possible to use a different level for different partitions in a table

In-Memory Column Store Populate: Compression CREATE TABLE ORDERS PARTITION BY RANGE (PARTITION p1 INMEMORY NO MEMCOMPRESS PARTITION p2 INMEMORY MEMCOMPRESS FOR DML, PARTITION p3 INMEMORY MEMCOMPRESS FOR QUERY, : PARTITION p200 INMEMORY MEMCOMPRESS FOR CAPACITY ); Different levels FOR DML Use on tables or partitions with very active DML activity FOR QUERY Default mode for most tables FOR CAPACITY For less frequently accessed segments Easy to switch levels as part of ILM strategy

In-Memory Column Store Populate: Under the Hood V$IM_SEGMENTS Shows current size of each segment in memory Shows how much remains to be populated SQL> select segment_name, populate_status, inmemory_priority, inmemory_size, bytes_not_populated from v$im_segments; SEGMENT_NAME POPULATE_STATUS INMEMORY_PRIORITY INMEMORY_SIZE BYTES_NOT_POPULATED ------------ --------------- ----------------- ------------- --------------- ---- ACCOUNTS STARTED HIGH 196606 2434886912 SALES COMPLETED CRITICAL 135790592 0

AGENDA In-Memory Column Format Getting Started with the IM Column Store In-Memory Performance Optimizations In-Memory Advisor In-Memory Scale-Out 25

In-Memory Performance Optimizations Columnar Format Vector Processing Operation pushdown In-Memory Storage Index Predicate Optimization 26

In-Memory Row Format: Slower for Analytics Buffer Cache SELECT COL4 FROM MYTABLE; X X X X X RESULT Row Format Needs to skip over unneeded data 27

In-Memory Columnar Format: Faster for Analytics IM Column Store SELECT COL4 FROM MYTABLE; Column Format X X X X RESULT Scans only the data required by the query 28

Vector Processing: Additional Advantage of Column Format Memory Example: Find all sales in state of CA Each CPU core scans only required columns CPU Load multiple region values STATE Vector Register CA CA CA CA Vector Compare all values in 1 instruction > 100x Faster SIMD vector instructions used to process multiple values in each instruction E.g. Intel AVX instructions with 256 bit vector registers Billions of rows/sec scan rate per CPU core Row format is millions/sec 29

Operation Pushdown: Reduce Rows Processed by Plan When possible, push operations down to In-Memory scan Greatly reduces # rows flowing up through the plan Similar to Exadata smart scan, just more smarter In addition to SIMD (on SIMD enabled platforms) For example: Predicate Evaluation (for qualifying predicates equality, range, etc.): Inline predicate evaluation within the scan Each IMCU scan only returns qualifying rows instead of all rows Sales > 1000 IM scan Products State = CA IM scan Stores CA SALES > 1000 STATE = CA 30

Operation Pushdown: Bloom Filter Example: Find total sales in outlet stores Stores Type Store ID Type= Outlet Bloom Filter StoreID in 15, 38, 64 Store ID Sales Amount Bloom Filter: Compact bit vector for set membership testing 10g optimizer feature Bloom filter pushdown: Filtering pushed down to IMCU scan Returns only rows that are likely to be join candidates Joins tables 10x faster Sum 31

In-Memory Storage Index: Eliminate IMCUs from Scan Min-Max Pruning Min/Max values serve as storage index Check predicate against min/max values Skip entire IMCU if predicate not satisfied Can prune for many predicates including equality, range, inlist, etc. Eliminates processing unnecessary IMCUs Example: Find stores with sales greater than $10,000 Min $4000 Max $7000 Min $8000 Max $12000 Min $13000 Max $15000 32

Predicate Optimization: Reduce Predicate Evaluations Avoid evaluating predicates against every column value Check range predicate against min/max values As before, skip IMCUs where min/max disqualifies predicate If min/max indicates all rows will qualify, no need to evaluate predicates on column values Also applies Dictionary based pruning Example: Find stores with sales between $8000 and $14000 Min $4000 Max $7000 Min $8000 Max $13000 NO ROWS Skip IMCU ALL ROWS Skip Evaluation? SOME ROWS Min $13000 Max $15000 Needs evaluation 33

Dictionary-based Pruning: Eliminate IMCUs from Scan On IMCUs where Dictionary is built -i.e. Dictionary is encoded Check against the Dictionary first Skip entire CU/IMCU if dictionary doesn t have the needed value Eliminates processing unnecessary IMCUs Example: Find cars built by GM VALUE ID Audi 0 BMW 1 Cadillac 2 VALUE ID Audi 0 BMW 1 GM 2 VALUE ID Audi 0 GM 1 Kia 2 34

AGENDA In-Memory Column Format Getting Started with the IM Column Store In-Memory Performance Optimizations In-Memory Advisor In-Memory Scale-Out 35

Oracle In-Memory Advisor In-Production Differentiates and analyzes analytics processing from other workloads via AWR, ASH, plan cardinality, and parallel execution Estimates In-Memory size of objects based on heuristics compression factors Provides list of objects that would benefit most from being populated into IM column store Can be installed on Oracle Database 11.2.0.3 an above

Oracle In-Memory Advisor Sample Report

AGENDA In-Memory Column Format Getting Started with the IM Column Store In-Memory Performance Optimizations In-Memory Advisor In-Memory Scale-Out 38

In-Memory and RAC Each node in RAC has its own IM column store Objects are automatically distributed across column store Scale-out policy is at segment level (table, (sub)partition) In-Memory queries parallelized acrossnodes to access local column data 39

In-Memory and RAC ALTER TABLE sales INMEMORY DISTRIBUTE BY PARTITION; ALTER TABLE COSTS INMEMORY DISTRIBUTE AUTO; Policy is user-specifiable Controlled by DISTRIBUTE subclause Distribute by rowid range Distribute by partition/subpartition Distribute AUTO (default) 40

Scale-Out: Distribute by Partition SALES 2000 2001 In-Memory Column Store In-Memory Column Store 2000 2004 2001 2005 2002 2003 2004 2005 In-Memory Column Store In-Memory Column Store 2002 2006 2003 2007 2006 2007 4 Node RAC Cluster 41

Oracle Database In-Memory: Unique Fault Tolerance Similar to storage mirroring Duplicate in-memory columns on another node Enabled per table/partition Application transparent Only Available on Engineered Systems Downtime eliminated by using duplicate after failure 42

Oracle Database In-Memory: Unique Fault Tolerance ALTER TABLE sales INMEMORY DUPLICATE; ALTER TABLE COSTS INMEMORY DISTRIBUTE AUTO DUPLICATE ALL; Policy is user-specifiable Controlled by DUPLICATEsubclause DUPLICATE DUPLICATE ALL Can improve performance by enabling co-located joins 43

DUPLICATE and DISTRIBUTE Example SALES Q1 Q2 In-Memory Column Store In-Memory Column Store Q4 Q3 SHIPPING In-Memory Column Store In-Memory Column Store 4 Node RAC Cluster 44

Oracle Database In-Memory Top Five Tips Remember it s a store -you control when data goes in & out Help the optimizer help you: gather representative set of statistics Use partitioning: provides fine grained control on what data is populated Remove unnecessary indexes: improves DML performance & reduce index confusion Use RAC to scale out:not only increases capacity but performance

Summary Dual Format Architecture Fully consistent row and column format Best of both worlds OLTP and Analytics performance. Typically, row format (Buffer cache) memory < 10% of column format memory New In-Memory Column Format In-memory only representation Seamlessly built into Oracle Database Engine Compatible with all Oracle Database features Cost Effective Use in-memory for hot data, flash for intermediate data, disk for cold data 46