Infrastructure at your Service. In-Memory-Pläne für den 12.2-Optimizer: Teuer oder billig?

Similar documents
Challenges in Query Optimization. Doug Inkster, Ingres Corp.

Just In Time Compilation in PostgreSQL 11 and onward

Vectorized Postgres (VOPS extension) Konstantin Knizhnik Postgres Professional

Oracle Database In-Memory

GPU-Accelerated Analytics on your Data Lake.

Tuning slow queries after an upgrade

ADMS/VLDB, August 27 th 2018, Rio de Janeiro, Brazil OPTIMIZING GROUP-BY AND AGGREGATION USING GPU-CPU CO-PROCESSING

Oracle 12.2 My Favorite Top Five New or Improved Features. Janis Griffin Senior DBA / Performance Evangelist

Oracle Database In-Memory

Oracle Database In-Memory

Efficient in-memory query execution using JIT compiling. Han-Gyu Park

In-Memory is Your Data Warehouse s New BFF

Oracle Database In-Memory with Oracle Database 18c

Quo Vadis SQLTXPLAIN

Infrastructure at your Service. DOAG Webinar. ODA 12c new features. ODA 12c new features

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

Oracle Database In-Memory By Example

Oracle Database In-Memory with Oracle Database 12c Release 2

Big Data analytics in insurance

Eine für Alle - Oracle DB für Big Data, In-memory und Exadata Dr.-Ing. Holger Friedrich

TPC-H Benchmark Set. TPC-H Benchmark. DDL for TPC-H datasets

Database In-Memory: A Deep Dive and a Future Preview

DOAG 2013 Oracle 12c Backup & Recovery

NewSQL Databases MemSQL and VoltDB Experimental Evaluation

Incrementally Updating Backups Tips and Tricks

Interpreting Explain Plan Output. John Mullins

Oracle Database 11gR2 Optimizer Insights

Real-World Performance Training Exadata and Database In-Memory

7. Query Processing and Optimization

Comparison of Database Cloud Services

Run Your Own Oracle Database Benchmarks with Hammerora

CC13c LifeCycle Management. Infrastructure at your Service.

Infrastructure Consolidation with OCI

Comparison of Database Cloud Services

Oracle Database 12c Performance Management and Tuning

Exadata X3 in action: Measuring Smart Scan efficiency with AWR. Franck Pachot Senior Consultant

Does Exadata Need Performance Tuning? Jože Senegačnik, Oracle ACE Director, Member of OakTable DbProf d.o.o. Ljubljana, Slovenia

Ensuring Optimal Performance. Vivek Sharma. 3 rd November 2012 Sangam 2012

Oracle Database In-Memory Hands-on Lab

Safe Harbor Statement

Learning Objectives : This chapter provides an introduction to performance tuning scenarios and its tools.

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

Monitoring WebLogic with WLDF

Oracle In-Memory & Data Warehouse: The Perfect Combination?

Oracle DB-Tuning Essentials

Oracle Database In-Memory What s New and What s Coming

When and How to Take Advantage of New Optimizer Features in MySQL 5.6. Øystein Grøvlen Senior Principal Software Engineer, MySQL Oracle

Real-World Performance Training SQL Introduction

Oracle Database 11g: Performance Tuning DBA Release 2

Exadata Implementation Strategy

Oracle Database Database In-Memory Guide. 12c Release 2 (12.2)

#1290. Oracle Core: InMemory Column Performing Databases GmbH Mitterteich / Germany

Implement SAML 2.0 SSO in WLS using IDM Federation Services

Exploring Best Practices and Guidelines for Tuning SQL Statements

Exadata Implementation Strategy

Oracle Database 11g : Performance Tuning DBA Release2

Oracle Sql Tuning- A Framework

Oracle Optimizer: What s New in Oracle Database 12c? Maria Colgan Master Product Manager

Leveraging Oracle Database In-Memory to Accelerate Business Analytic Applications

Oracle Database 11g: Performance Tuning DBA Release 2

Insider s Guide on Using ADO with Database In-Memory & Storage-Based Tiering. Andy Rivenes Gregg Christman Oracle Product Management 16 November 2016

SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability

High Volume In-Memory Data Unification

Oralogic Education Systems

Databases Clone using ACFS. Infrastructure at your Service.

Data Warehouse Tuning. Without SQL Modification

Recent Innovations in Data Storage Technologies Dr Roger MacNicol Software Architect

JITing PostgreSQL using LLVM

20 Essential Oracle SQL and PL/SQL Tuning Tips. John Mullins

Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor

Exploring Oracle Database 11g/12c Partitioning New Features and Best Practices. Ami Aharonovich Oracle ACE & OCP

Optimized Analytical Processing New Features with 11g R2

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

PERFORMANCE TUNING TRAINING IN BANGALORE

Real-World Performance Training SQL Performance

<Insert Picture Here> DBA s New Best Friend: Advanced SQL Tuning Features of Oracle Database 11g

Real-World Performance Training Star Query Edge Conditions and Extreme Performance

Apache Hive for Oracle DBAs. Luís Marques

Session id: The Self-Managing Database: Guided Application and SQL Tuning

Histogram Support in MySQL 8.0

IT-Tage Dezember 2016 Frankfurt am Main Maritim Hotel

EZY Intellect Pte. Ltd., #1 Changi North Street 1, Singapore

Leveraging Oracle Database In- Memory to accelerate Oracle Business Intelligence Analytics Applications

Oracle Database 11g: SQL Tuning Workshop

12.2 Multitenant New Security Features Clarify DevOps and DBA role separation

ORACLE TRAINING CURRICULUM. Relational Databases and Relational Database Management Systems

Oracle 1Z0-054 Exam Questions and Answers (PDF) Oracle 1Z0-054 Exam Questions 1Z0-054 BrainDumps

Programming Languages

Eternal Story on Temporary Objects

Advanced Oracle SQL Tuning v3.0 by Tanel Poder

<Insert Picture Here> Looking at Performance - What s new in MySQL Workbench 6.2

<Insert Picture Here> Inside the Oracle Database 11g Optimizer Removing the black magic

When should an index be used?

Optimize OLAP & Business Analytics Performance with Oracle 12c In-Memory Database Option

Internals of Active Dataguard. Saibabu Devabhaktuni

Oracle Database 18c New Performance Features

Oracle 1Z0-515 Exam Questions & Answers

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

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including:

Informatica Data Explorer Performance Tuning

Transcription:

Infrastructure at your Service. In-Memory-Pläne für den 12.2-Optimizer: Teuer oder billig?

About me Infrastructure at your Service. Clemens Bleile Senior Consultant Oracle Certified Professional DB 11g, 12c Oracle Certified Expert DB 12c Performance Management and Tuning +41 78 677 51 09 clemens.bleile@dbi-services.com Page 2

Who we are dbi services Experts At Your Service > 50 specialists in IT infrastructure > Certified, experienced, passionate Based In Switzerland > 100% self-financed Swiss company > Over CHF6 mio. turnover Leading In Infrastructure Services > More than 120 customers in CH, D, & F > Over 40 SLAs dbi FlexService contracted Page 3

Agenda 1. Oracle Database In-Memory 2. In-Memory and the Optimizer 3. New In-Memory features in 12cR2 related to the Optimizer 4. Test results with HammerDB TPC-H Page 4

Oracle Database In-Memory > Why In-Memory? > In-Memory Goals > Architecture Page 5

What is Database In-Memory? In-Memory Goals? Page 6

What is Database In-Memory? Architecture Oracle 12.1.0.2 introduced new columnar format > New format does NOT replace existing row format > Standard memory pools keeps row format and Oracle block size structure EMP Buffer cache EMP Column Store EMPNO ENAME JOB EMPNO ENAME JOB 7902 FORD ANALYST 7903 ALLAN CLERK 7904 BLAKE SALESMAN 7902 7903 7904 FORD ALLAN BLAKE ANALYST CLERK SALESMAN update population Table EMP EMPNO ENAME JOB 7902 FORD ANALYST Page 7

What is Database In-Memory? Architecture Extent #6 Extent #7 Extent #8 Page 9

What is Database In-Memory? Architecture JOB CLERK DICT Dictionary CLERK 0 Column Compression Unit (CU) > Contiguous storage per column in an IMCU SALESMAN SALESMAN SALESMAN SALESMAN MANAGER MANAGER SALESMAN 1 MANAGER 2 ANALYST 3 PRESIDENT 4 JOB > All CUs automatically store Min/Max values > Multiple formats: depends on data and chosen compression level > Most CUs have a Dictionary > Sorted list of distinct values in the CU ANALYST PRESIDENT SALESMAN CLERK CLERK ANALYST ANALYST min: ANALYST max: SALESMAN 0 1 1 1 1 2 > Column values replaced with dictionary IDs > Compression Units are indexed (like Exadata Storage Index) 2 3 Page 9

What is Database In-Memory? Architecture Query just what s needed Access only needed columns > In Buffer Cache all columns are scanned EMP Buffer Cache EMP Column Store EMPNO ENAME JOB EMPNO ENAME JOB 7902 7903 7904 FORD ALLAN BLAKE ANALYST CLERK SALESMAN 7902 7903 7904 FORD ALLAN BLAKE ANALYST CLERK SALESMAN Scan and filter compressed data > Data is populated in compressed format > Compressed format allows WHERE-clause predicates to be evaluated against the compressed data (except for compression CAPACITY LOW/HIGH) SCAN LESS BYTES THAN IN BUFFER CACHE Page 10

What is Database In-Memory? Architecture Query just what s needed Storage Indexes > Similar to Exadata Storage Indexes > They are automatically maintained for each column in the Column Store > Store the Min/Max values of each CU > Purpose is to avoid accessing the IMCUs that do not contain relevant data > Pruning happens at 2 levels: > predicate outside min/max prune storage index > equally predicate > min and < max prune if dictionary compressed and value is not in the list of distinct dictionary values Demo Page 11

What is Database In-Memory? Architecture SIMD (Single Instruction processing Multiple Data values) > Evaluate a set of data values in a single CPU instruction > Scan rows in the range of billions/sec per core instead of millions/sec per core (buffer cache) Page 12

In-Memory and the Optimizer > What does the optimizer know about IM? > The 10053 Trace > In-Memory Joins Page 13

In-Memory and the Optimizer What does the optimizer know about IM? Cost model has been expanded to consider in-memory operations > Still considers statistics gathered with dbms_stats > Tables, columns, indexes, partitions > Still considers system statistics > CPU-speed, IO-throughput for single and multiblock-reads > In-memory specific statistics Data Dictionary > Stats maintained about in-memory objects since starting populating the in-memory column store System stats Index/Table/ Partition/Column Optimizer In-Memory statistics Page 14

In-Memory and the Optimizer What does the optimizer know about IM? The basic rules about statistics gathering still apply with IM: > Use DBMS_STATS.GATHER_..._STATS to gather statistics > User Histograms in case of data skew > Use extended statistics so that the optimizer knows about correlations: single table cardinality, joins, aggregations > Use constraints (e.g. PK/FK, Not Null) Data Dictionary System stats Index/Table/ Partition/Column Optimizer In-Memory statistics Page 15

In-Memory and the Optimizer What does the optimizer know about IM? New In-Memory statistics > Automatically computed during hard parse > In Memory Compression Units > IM Rows > Transaction Journal Rows > IM Blocks > IM Quotient > How much has been populated: 0-1 Data Dictionary System stats Index/Table/ Partition/Column Optimizer In-Memory statistics Page 16

In-Memory and the Optimizer What does the optimizer know about IM? IM Costs > IO costs > Read not populated/read consistent (invalid) rows > Extent Map > CPU costs > Traverse IMCUs > Check storage indexes (pruning) > Decompressing > Predicate evaluation > Row stitch > Scanning the journal Optimizer In-Memory statistics Page 17

In-Memory and the Optimizer The 10053 trace Page 18

In-Memory and the Optimizer The 10053 trace Page 19

In-Memory and the Optimizer The 10053 trace Page 20

In-Memory and the Optimizer The 10053 trace Page 21

In-Memory and the Optimizer The 10053 trace Page 22

In-Memory and the Optimizer In-Memory Joins Joining In-Memory with Bloom Filters (12cR1) Page 23

In-Memory and the Optimizer In-Memory Joins Page 24

In-Memory and the Optimizer In-Memory Joins Page 25

In-Memory and the Optimizer In-Memory Joins Page 26

New In-Memory features in 12cR2 > In-Memory Expressions > Join-Groups Page 27

New In-Memory features in 12cR2 In-Memory Expressions What are In-Memory Expressions? > Frequently computed expressions are pre-computed as In-Memory expressions (IME) > IMEs can be created for > Virtual columns > Automatic capture > Frequently evaluated query expressions > Other internal computations (hash join values, predicate evaluations, data conversions) > Repeated expression evaluation can be computationally expensive > Very useful for large datasets > Still supports other In-Memory optimizations (min/max pruning, SIMD, etc.) Page 28

New In-Memory features in 12cR2 In-Memory Expressions Example of In-Memory Expressions select l_returnflag, l_linestatus, sum(l_quantity) as sum_qty, sum(l_extendedprice) as sum_base_price, sum(l_extendedprice * (1 - l_discount)) as sum_disc_price, sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge, avg(l_quantity) as avg_qty, avg(l_extendedprice) as avg_price, avg(l_discount) as avg_disc, count(*) as count_order from lineitem where l_shipdate >= to_date ('2015-12-01','YYYY-MM-DD') - 90 group by l_returnflag, l_linestatus order by l_returnflag, l_linestatus; Page 29

New In-Memory features in 12cR2 In-Memory Expressions How do In-Memory Expressions work? > In-Memory columns consisting of > User defined virtual columns create table T1 (a number, b number, v as (a+b)); > Automatic capture > Frequently evaluated (hot) query expressions select a*b from T1 where a/b = 1; One or more columns of a single row of a table, possibly some constants Have a 1-to-1 mapping with the rows in the table > Other useful internal computations (e.g. hash join values) > Oracle JSON > Tree-based binary encoding of JSON Page 30

New In-Memory features in 12cR2 The IM Expression Statistics Store (ESS) Page 31

New In-Memory features in 12cR2 In-Memory Expressions In-Memory Expressions > Expressions Statistics Store (ESS) > Is maintained by the Optimizer layer > Identifies query expressions during hard parse > Maintains expression evaluation statistics > Frequency of execution > Cost of evaluation > Timestamp of evaluation > Hotness of score > Persisted to disk (and cached in SGA) > Exposed in the view all dba user_expression_statistics Page 32

New In-Memory features in 12cR2 In-Memory Expressions Page 33

New In-Memory features in 12cR2 In-Memory Expressions In-Memory Expressions > IMEs are stored in In-Memory Expression Units IMEU (like In- Memory Column Units (IMCUs) with subtle differences) > 1-to-1 mapping with rows of IMCU > Tied to parent IMCU lifespan > Memory from IMCU 1MB pool > Consider the space usage in IM for the IMEUs. It may consume considerable amount of space with default compression level > Generally provides same statistics as for CUs: > IM populate EUs... > IM prepopulate EUs... > IM repopulate EUs... > IM scan EUs... > e.g. IM scan EU bytes in-memory, IM scan EU rows Demo Page 34

New In-Memory features in 12cR2 Join-Groups JOB CLERK DICT Dictionary CLERK 0 Column Compression Unit (CU) > Most CUs have a Dictionary SALESMAN SALESMAN SALESMAN SALESMAN MANAGER MANAGER ANALYST PRESIDENT SALESMAN CLERK CLERK ANALYST ANALYST SALESMAN 1 MANAGER 2 ANALYST 3 PRESIDENT 4 JOB min: ANALYST max: SALESMAN 0 1 1 1 1 2 > Sorted list of distinct values in the CU > Column values replaced with dictionary IDs > Idea of join groups is to compress the join columns in both tables based on the same dictionary > Join occurs on dictionary values rather than on data > Saves on decompressing data > Saves on hashing the data 2 3 Page 35

New In-Memory features in 12cR2 Join-Groups Join between Vehicles and Sales based on brand (NAME) Global dictionary created when first table is populated and used for joining columns in both tables. Page 36

New In-Memory features in 12cR2 Join-Groups Join between Vehicles and Sales based on brand (NAME) PGA 5. Hash join completes by looking up compressed values in array 0 1 3 5 90 2. An array of distinct values is created from the compressed values 4. Matching rows are sent to the hash join in compressed format VEHICLES 1. Table VEVICLE scanned and matching join columns sent to join in compressed format 3. Table SALES is scanned and rows are filtered based on query predicate SALES Page 37

New In-Memory features in 12cR2 Join-Groups Creating and managing a Join Group CREATE INMEMORY JOIN GROUP vech_sales_jg (VEHICLES(NAME),SALES(NAME)); SELECT o.object_name table_name, c.column_name column_name, gd.head_address "GD Address" FROM user_objects o, user_tab_columns c, v$im_segdict gd WHERE gd.objn = o.object_id AND o.object_name = c.table_name AND gd.column_number = c.column_id; Page 38

Conclusion > The optimizer is In-Memory aware > In-Memory statistics are gathered/considered at parse time > New optimizer transformations and join methods available > Additional hints are available to (not) use In-Memory > In-Memory is very good joining small datasets with large datasets > Very good support of parallelism > DDLs gain from IM as well: CTAS, Create Index > Adaptive Stats read from IM > License costs (Active Data Guard + In-Memory) > Joining large datasets may not be faster with IM > Some features available on engineered systems only Page 39

Any questions? Please do ask Infrastructure at your Service. Clemens Bleile Senior Consultant +41 78 677 51 09 clemens.bleile@dbi-services.com We look forward to working with you! Page 40

Let s meet at booth 242