SlideShare ist ein Scribd-Unternehmen logo
1 von 34
Downloaden Sie, um offline zu lesen
2014 © Trivadis 
BASEL BERN BRUGG LAUSANNE ZUERICH DUESSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA 
Oracle Database 12.1.0.2 New Performance Features 
DOAG 2014, Nürnberg (DE) Christian Antognini 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
1
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
2 
@ChrisAntognini 
Senior principal consultant, trainer and partner at Trivadis in Zurich (CH) 
christian.antognini@trivadis.com 
http://antognini.ch 
Focus: get the most out of Oracle Database 
Logical and physical database design 
Query optimizer 
Application performance management 
Author of Troubleshooting Oracle Performance (Apress, 2008/2014) 
OakTable Network, Oracle ACE Director
2014 © Trivadis 
1.Zone Maps 
2.Attribute Clustering 
3.In-Memory Column Store 
4.In-Memory Aggregation 
5.Approximate Count Distinct 
6.Automatic Big Table Caching 
7.Full Database Caching 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
3 
AGENDA
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
Zone Maps 
4
2014 © Trivadis 
A zone map is a redundant access structure associated to a table. 
At most one zone map per table can be created. 
Zone maps are intended to reduce the number of logical/physical I/O during table scans. 
Zone pruning 
Partition pruning 
Requirements to use zone maps: 
Oracle Partitioning option 
Exadata or Supercluster  
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
5 
Zone Maps
2014 © Trivadis 
The target table is divided in zones. 
SYS_OP_ZONE_ID(ROWID,SCALE) 
A zone consists of a specific number of blocks. 
The SCALE attribute controls it 
#푏푙표푐푘푠=2푠푐푎푙푒 
For every zone, the zone map stores the minimum and maximum values of several columns. 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
6 
How Is a Zone Map Built and What Does It Contain? 
Zone 1 – Min 4 / Max 34 
Zone 2 – Min 1 / Max 666 
Zone 3 – Min 56 / Max 145 
Zone 4 – Min 54 / Max 111 
Zone 5 – Min 95 / Max 101
2014 © Trivadis 
A basic zone map stores information about the columns of a single table. 
A zone map is a materialized view with some particular properties. 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
7 
Basic Zone Map 
CREATE MATERIALIZED ZONEMAP p_bzm ON p (id, n1, n2) 
SQL> SELECT object_type, object_name 
2 FROM user_objects 
3 WHERE object_name LIKE '%P_BZM'; 
OBJECT_TYPE OBJECT_NAME 
----------------- ------------- 
MATERIALIZED VIEW P_BZM 
TABLE P_BZM 
INDEX I_ZMAP$_P_BZM
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
8 
Basic Zone Maps – Execution Plan 
SELECT count(*) FROM p WHERE n1 = 42 
-------------------------------------------------------- 
| Id | Operation | Name | 
-------------------------------------------------------- 
| 0 | SELECT STATEMENT | | 
| 1 | SORT AGGREGATE | | 
|* 2 | TABLE ACCESS STORAGE FULL WITH ZONEMAP| P | 
-------------------------------------------------------- 
2 - storage("N1"=42) 
filter((SYS_ZMAP_FILTER('/* ZM_PRUNING */ SELECT "ZONE_ID$", 
CASE WHEN BITAND(zm."ZONE_STATE$",1)=1 THEN 1 ELSE CASE 
WHEN (zm."MIN_2_N1" > :1 OR zm."MAX_2_N1" < :2) THEN 3 
ELSE 2 END END FROM "CHRIS"."P_ZM" zm 
WHERE zm."ZONE_LEVEL$"=0 ORDER BY zm."ZONE_ID$"', 
SYS_OP_ZONE_ID(ROWID),42,42)<3 AND "N1"=42))
2014 © Trivadis 
A join zone map stores information about the columns of several tables. 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
9 
Join Zone Maps 
CREATE MATERIALIZED ZONEMAP p_jzm AS 
SELECT sys_op_zone_id(p.rowid) AS zone_id$, 
min(p.n1) AS min_p_n1, max(p.n1) AS max_p_n1, 
min(p.n2) AS min_p_n2, max(p.n2) AS max_p_n2, 
min(c.n1) AS min_c_n1, max(c.n1) AS max_c_n1, 
min(c.n2) AS min_c_n2, max(c.n2) AS max_c_n2 
FROM p LEFT OUTER JOIN c ON p.id = c.p_id 
GROUP BY sys_op_zone_id(p.rowid)
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
10 
Join Zone Maps – Execution Plan 
SELECT count(*) FROM p JOIN c ON p.id = c.p_id WHERE c.n2 = 42 
--------------------------------------------------------- 
| Id | Operation | Name | 
--------------------------------------------------------- 
| 0 | SELECT STATEMENT | | 
| 1 | SORT AGGREGATE | | 
|* 2 | HASH JOIN | | 
|* 3 | TABLE ACCESS STORAGE FULL | C | 
|* 4 | TABLE ACCESS STORAGE FULL WITH ZONEMAP| P | 
--------------------------------------------------------- 
2 - access("P"."ID"="C"."P_ID") 
3 - storage("C"."N2"=42) 
filter("C"."N2"=42) 
4 - filter(SYS_ZMAP_FILTER('/* ZM_PRUNING */ SELECT "ZONE_ID$", 
CASE WHEN BITAND(zm."ZONE_STATE$",1)=1 THEN 1 ELSE … )
2014 © Trivadis 
Zone maps are redundant access structures that are not always up-to-date. 
Basic zone maps: 
DML  selective invalidation 
Direct-path insert  automatic maintenance 
Join zone maps (created on the parent table): 
DML on parent  selective invalidation 
Direct-path insert on parent  automatic maintenance 
DML or direct-path insert on child  full invalidation 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
11 
Staleness of Zone Maps
2014 © Trivadis 
To refresh a zone map two techniques are available: 
ALTER MATERIALIZED ZONEMAP REBUILD statement 
REFRESH procedure of DBMS_MVIEW package 
Complete as well as fast refreshes are available. 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
12 
Refreshing Zone Maps
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
Attribute Clustering 
13
2014 © Trivadis 
Clustering data that is processed together is an old optimization technique. 
Index and hash clusters 
Heap table reorganization for improving the clustering factor of an important index 
Clustered data makes a number of features more effective 
B-tree index range scans 
Compression 
Exadata/In-Memory storage indexes 
Zone maps pruning 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
14 
Clustering Data
2014 © Trivadis 
Attribute clustering is a new table directive that specifies 
on which column(s) data has to be clustered 
how data is ordered (linear, interleaved) 
when clustering takes place 
Keeping data clustered may be expensive. Therefore, the database engine doesn’t enforce it. 
It only takes place in case of direct-path inserts and data movement operations. 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
15 
Attribute Clustering 
ALTER TABLE t CLUSTERING BY LINEAR ORDER (id) YES ON LOAD
2014 © Trivadis 
It’s also possible to cluster data based on column(s) of another table 
The joined table must have a PK or UK (ORA-65418) 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
16 
Join Attribute Clustering 
CREATE TABLE p (id NUMBER, 
n NUMBER, 
pad VARCHAR2(100), 
CONSTRAINT p_pk PRIMARY KEY (id)) 
CREATE TABLE c (id NUMBER, 
p_id NUMBER, 
p_n NUMBER, 
pad VARCHAR2(100)) 
CLUSTERING c JOIN p ON (c.p_id = p.id) BY LINEAR ORDER (p.n)
2014 © Trivadis 
It is possible to combine attribute clustering with zone maps 
Both clustering and the zone map are based on the same columns 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
17 
Attribute Clustering and Zone Maps 
CREATE TABLE c ( 
id NUMBER, 
p_id NUMBER, 
p_n NUMBER, 
pad VARCHAR2(100) 
) 
CLUSTERING c JOIN p ON (c.p_id = p.id) BY LINEAR ORDER (p.n) 
WITH MATERIALIZED ZONEMAP (c_zm)
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
In-Memory Aggregation 
18
2014 © Trivadis 
To optimize queries against a star schema, the query optimizer should do the following: 
Start evaluating each dimension table that has restrictions on it. 
Assemble a list with the resulting dimension keys. 
Use this list to extract the matching rows from the fact table. 
This approach cannot be implemented with regular joins. 
The query optimizer can join only two data sets at one time. 
Joining two dimension tables leads to a Cartesian product. 
To solve this problem, Oracle Database implements two query transformations: 
Star transformation 
Vector transformation (new in 12.1.0.2 – requires the In-Memory option) 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
19 
The Star Schema Challenge
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
20 
Star Transformation vs. Vector Transformation 
Selectivity 
Elapsed Time
2014 © Trivadis 
In the documentation Oracle refers to it as In-Memory Aggregation 
It isn’t only about aggregation 
It requires the In-Memory option because it takes advantage of some of its features 
INMEMORY_SIZE must be greater than 0 
The query optimizer considers it when 
equijoins are used 
an aggregate function is applied to a column of the fact table 
the query contains a GROUP BY clause 
-ROLLUP, CUBE and GROUPING SETS are not yet supported 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
21 
Vector Transformation (1)
2014 © Trivadis 
It’s a cost-based query transformation 
It can be controlled through the (NO_)VECTOR_TRANSFORM hints 
As with the star transformation, sometimes is not possible to force it 
It introduces new row source operations 
KEY VECTOR CREATE 
KEY VECTOR USE 
VECTOR GROUP BY 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
22 
Vector Transformation (2)
2014 © Trivadis 
1.For every dimension table with a filter on it the following operations take place 
Access table and filter data 
Create key vector 
Aggregate data 
Create temporary table 
2.Access the fact table through a FTS and filter data by applying the key vectors 
On Exadata the filter is not yet offloaded 
3.Aggregate data with either a vector or hash aggregation 
4.Join data from the fact table to temporary tables 
5.Join dimension tables without a filter on them 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
23 
Vector Transformation – Processing Steps
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
24 
Example 
SELECT c.customer_class, sum(o.order_total) 
FROM orders o, customers c, warehouses w 
WHERE o.customer_id = c.customer_id 
AND o.warehouse_id = w.warehouse_id 
AND c.dob BETWEEN :b1 AND :b2 
AND w.warehouse_name BETWEEN :b3 AND :b4 
GROUP BY c.customer_class 
customers 
orders 
warehouses
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
25 
Execution Plan – Access Dimension Tables, Create Key Vectors, and Create Temporary Tables 
------------------------------------------------------------------------- 
| Id | Operation | Name | 
------------------------------------------------------------------------- 
| 0 | SELECT STATEMENT | | 
| 1 | TEMP TABLE TRANSFORMATION | | 
| 2 | LOAD AS SELECT | SYS_TEMP_0FD9DE69C_28565764 | 
| 3 | VECTOR GROUP BY | | 
| 4 | KEY VECTOR CREATE BUFFERED | :KV0000 | 
|* 5 | TABLE ACCESS STORAGE FULL | CUSTOMERS | 
| 6 | LOAD AS SELECT | SYS_TEMP_0FD9DE69D_28565764 | 
| 7 | VECTOR GROUP BY | | 
| 8 | HASH GROUP BY | | 
| 9 | KEY VECTOR CREATE BUFFERED | :KV0001 | 
|* 10 | TABLE ACCESS STORAGE FULL | WAREHOUSES | 
...
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
26 
Execution Plan – Access Fact Table by Applying Key Vectors, and Join Temporary Tables 
... 
| 11 | HASH GROUP BY | | 
|* 12 | HASH JOIN | | 
| 13 | MERGE JOIN CARTESIAN | | 
| 14 | TABLE ACCESS STORAGE FULL | SYS_TEMP_0FD9DE69D_28565764 | 
| 15 | BUFFER SORT | | 
| 16 | TABLE ACCESS STORAGE FULL | SYS_TEMP_0FD9DE69C_28565764 | 
| 17 | VIEW | VW_VT_72AE2D8F | 
| 18 | VECTOR GROUP BY | | 
| 19 | HASH GROUP BY | | 
| 20 | KEY VECTOR USE | :KV0001 | 
| 21 | KEY VECTOR USE | :KV0000 | 
|* 22 | TABLE ACCESS STORAGE FULL| ORDERS | 
------------------------------------------------------------------------- 
... 
22 - filter(SYS_OP_KEY_VECTOR_FILTER("O"."CUSTOMER_ID",:KV0000) AND 
SYS_OP_KEY_VECTOR_FILTER("O"."WAREHOUSE_ID",:KV0001))
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
Approximate Count Distinct 
27
2014 © Trivadis 
Computing the number of distinct values can be resource intensive 
In some situation performance is more important than precision 
Many algorithms that estimate the number of distinct values have been developed 
Oracle implemented one of this algorithms (HyperLogLog) 
In case an estimated number of distinct values is acceptable, you can replace COUNT(DISTINCT expr) with APPROX_COUNT_DISTINCT(expr) 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
28 
APPROX_COUNT_DISTINCT Function
2014 © Trivadis 
100’000’000 rows 
12.7 GB 
24 columns 
Number of distinct values is 2m, where 푚∈ℕ∗푚<25 
Test queries 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
29 
Test Case – Setup 
SELECT count(DISTINCT n_m) FROM t 
SELECT approx_count_distinct(n_m) FROM t
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
30 
Test Case – Elapsed Time 
0 
10 
20 
30 
40 
2 
4 
8 
16 
32 
64 
128 
256 
512 
1024 
2048 
4096 
8192 
16384 
32768 
65536 
131072 
262144 
524288 
1048576 
2097152 
4194304 
8388608 
16777216 
Elapsed Time [s] 
Number of Distinct Values 
COUNT(DISTINCT) 
APPROX_COUNT_DISTINCT()
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
31 
Test Case – PGA Utilization 
1 
10 
100 
1000 
2 
4 
8 
16 
32 
64 
128 
256 
512 
1024 
2048 
4096 
8192 
16384 
32768 
65536 
131072 
262144 
524288 
1048576 
2097152 
4194304 
8388608 
16777216 
PGA [MB] 
Number of Distinct Values 
COUNT(DISTINCT) 
APPROX_COUNT_DISTINCT()
2014 © Trivadis 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
32 
Test Case – Precision 
-4 
-2 
0 
2 
4 
2 
4 
8 
16 
32 
64 
128 
256 
512 
1024 
2048 
4096 
8192 
16384 
32768 
65536 
131072 
262144 
524288 
1048576 
2097152 
4194304 
8388608 
16777216 
Error in Percent 
Number of Distinct Values
2014 © Trivadis 
Core Messages 
Zone Maps 
Interesting concept, but mostly useless because of licensing rule 
Attribute Clustering 
Declarative way to implement old but good technique for “load-once read-many” data 
In-Memory Aggregation 
Very interesting concept, complements the star transformation 
Approximate Count Distinct 
Useful feature, sound implementation 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
33
2014 © Trivadis 
Questions and answers ... 
BASEL BERN BRUGG LAUSANNE ZUERICH DUESSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA 
Christian Antognini Principal Senior Consultant 
christian.antognini@trivadis.com 
19 November 2014 
Oracle Database 12.1.0.2 New Performance Features 
34

Weitere ähnliche Inhalte

Was ist angesagt?

Oracle 12c New Features_RMAN_slides
Oracle 12c New Features_RMAN_slidesOracle 12c New Features_RMAN_slides
Oracle 12c New Features_RMAN_slidesSaiful
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAiougVizagChapter
 
Oracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New FeaturesOracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New FeaturesDeiby Gómez
 
Best Practices – Extreme Performance with Data Warehousing on Oracle Database
Best Practices – Extreme Performance with Data Warehousing on Oracle DatabaseBest Practices – Extreme Performance with Data Warehousing on Oracle Database
Best Practices – Extreme Performance with Data Warehousing on Oracle DatabaseEdgar Alejandro Villegas
 
Indexing in Exadata
Indexing in ExadataIndexing in Exadata
Indexing in ExadataEnkitec
 
Oracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam BashaOracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam Bashapasalapudi123
 
Whitepaper: Exadata Consolidation Success Story
Whitepaper: Exadata Consolidation Success StoryWhitepaper: Exadata Consolidation Success Story
Whitepaper: Exadata Consolidation Success StoryKristofferson A
 
Understanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
Understanding Query Optimization with ‘regular’ and ‘Exadata’ OracleUnderstanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
Understanding Query Optimization with ‘regular’ and ‘Exadata’ OracleGuatemala User Group
 
Oracle12c data guard farsync and whats new
Oracle12c data guard farsync and whats newOracle12c data guard farsync and whats new
Oracle12c data guard farsync and whats newNassyam Basha
 
PostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesPostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesSaiful
 
PostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingPostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingAmir Reza Hashemi
 
Oracle Rac Performance Tunning Tips&Tricks
Oracle Rac Performance Tunning Tips&TricksOracle Rac Performance Tunning Tips&Tricks
Oracle Rac Performance Tunning Tips&TricksZekeriya Besiroglu
 
Database Consolidation using Oracle Multitenant
Database Consolidation using Oracle MultitenantDatabase Consolidation using Oracle Multitenant
Database Consolidation using Oracle MultitenantPini Dibask
 
Indexes: Structure, Splits and Free Space Management Internals
Indexes: Structure, Splits and Free Space Management InternalsIndexes: Structure, Splits and Free Space Management Internals
Indexes: Structure, Splits and Free Space Management InternalsChristian Antognini
 
VirtaThon 2011 - Mining the AWR
VirtaThon 2011 - Mining the AWRVirtaThon 2011 - Mining the AWR
VirtaThon 2011 - Mining the AWRKristofferson A
 
Oracle database 12c new features
Oracle database 12c new featuresOracle database 12c new features
Oracle database 12c new featuresRemote DBA Services
 
A Deep Dive into ASM Redundancy in Exadata
A Deep Dive into ASM Redundancy in ExadataA Deep Dive into ASM Redundancy in Exadata
A Deep Dive into ASM Redundancy in ExadataEmre Baransel
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuningGuy Harrison
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi TenantRed Stack Tech
 

Was ist angesagt? (20)

Oracle 12c New Features_RMAN_slides
Oracle 12c New Features_RMAN_slidesOracle 12c New Features_RMAN_slides
Oracle 12c New Features_RMAN_slides
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
Oracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New FeaturesOracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New Features
 
Best Practices – Extreme Performance with Data Warehousing on Oracle Database
Best Practices – Extreme Performance with Data Warehousing on Oracle DatabaseBest Practices – Extreme Performance with Data Warehousing on Oracle Database
Best Practices – Extreme Performance with Data Warehousing on Oracle Database
 
Indexing in Exadata
Indexing in ExadataIndexing in Exadata
Indexing in Exadata
 
Oracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam BashaOracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam Basha
 
Whitepaper: Exadata Consolidation Success Story
Whitepaper: Exadata Consolidation Success StoryWhitepaper: Exadata Consolidation Success Story
Whitepaper: Exadata Consolidation Success Story
 
10053 otw
10053 otw10053 otw
10053 otw
 
Understanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
Understanding Query Optimization with ‘regular’ and ‘Exadata’ OracleUnderstanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
Understanding Query Optimization with ‘regular’ and ‘Exadata’ Oracle
 
Oracle12c data guard farsync and whats new
Oracle12c data guard farsync and whats newOracle12c data guard farsync and whats new
Oracle12c data guard farsync and whats new
 
PostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesPostgreSQL 9.5 Features
PostgreSQL 9.5 Features
 
PostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / ShardingPostgreSQL Table Partitioning / Sharding
PostgreSQL Table Partitioning / Sharding
 
Oracle Rac Performance Tunning Tips&Tricks
Oracle Rac Performance Tunning Tips&TricksOracle Rac Performance Tunning Tips&Tricks
Oracle Rac Performance Tunning Tips&Tricks
 
Database Consolidation using Oracle Multitenant
Database Consolidation using Oracle MultitenantDatabase Consolidation using Oracle Multitenant
Database Consolidation using Oracle Multitenant
 
Indexes: Structure, Splits and Free Space Management Internals
Indexes: Structure, Splits and Free Space Management InternalsIndexes: Structure, Splits and Free Space Management Internals
Indexes: Structure, Splits and Free Space Management Internals
 
VirtaThon 2011 - Mining the AWR
VirtaThon 2011 - Mining the AWRVirtaThon 2011 - Mining the AWR
VirtaThon 2011 - Mining the AWR
 
Oracle database 12c new features
Oracle database 12c new featuresOracle database 12c new features
Oracle database 12c new features
 
A Deep Dive into ASM Redundancy in Exadata
A Deep Dive into ASM Redundancy in ExadataA Deep Dive into ASM Redundancy in Exadata
A Deep Dive into ASM Redundancy in Exadata
 
Oracle sql high performance tuning
Oracle sql high performance tuningOracle sql high performance tuning
Oracle sql high performance tuning
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi Tenant
 

Ähnlich wie Oracle Database 12.1.0.2 New Performance Features

OracleDatabase12cPXNewFeatures_ITOUG_2018.pdf
OracleDatabase12cPXNewFeatures_ITOUG_2018.pdfOracleDatabase12cPXNewFeatures_ITOUG_2018.pdf
OracleDatabase12cPXNewFeatures_ITOUG_2018.pdf7vkx8892hv
 
Apache Lens at Hadoop meetup
Apache Lens at Hadoop meetupApache Lens at Hadoop meetup
Apache Lens at Hadoop meetupamarsri
 
IBM Pure Data System for Analytics (Netezza)
IBM Pure Data System for Analytics (Netezza)IBM Pure Data System for Analytics (Netezza)
IBM Pure Data System for Analytics (Netezza)Girish Srivastava
 
Scaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQLScaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQLJim Mlodgenski
 
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...Marco Tusa
 
Apache Sqoop: A Data Transfer Tool for Hadoop
Apache Sqoop: A Data Transfer Tool for HadoopApache Sqoop: A Data Transfer Tool for Hadoop
Apache Sqoop: A Data Transfer Tool for HadoopCloudera, Inc.
 
Functional Web Development
Functional Web DevelopmentFunctional Web Development
Functional Web DevelopmentFITC
 
My SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMy SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMarkus Flechtner
 
Introduction to Apache Spark
Introduction to Apache SparkIntroduction to Apache Spark
Introduction to Apache SparkDatio Big Data
 
Introduction to Mahout
Introduction to MahoutIntroduction to Mahout
Introduction to MahoutTed Dunning
 
Introduction to Mahout given at Twin Cities HUG
Introduction to Mahout given at Twin Cities HUGIntroduction to Mahout given at Twin Cities HUG
Introduction to Mahout given at Twin Cities HUGMapR Technologies
 
High Throughput Analytics with Cassandra & Azure
High Throughput Analytics with Cassandra & AzureHigh Throughput Analytics with Cassandra & Azure
High Throughput Analytics with Cassandra & AzureDataStax Academy
 
D3 d12 a-new-meaning-for-efficiency-and-performance
D3 d12 a-new-meaning-for-efficiency-and-performanceD3 d12 a-new-meaning-for-efficiency-and-performance
D3 d12 a-new-meaning-for-efficiency-and-performancemistercteam
 
D3 d12 a-new-meaning-for-efficiency-and-performance
D3 d12 a-new-meaning-for-efficiency-and-performanceD3 d12 a-new-meaning-for-efficiency-and-performance
D3 d12 a-new-meaning-for-efficiency-and-performancemistercteam
 
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...Nelson Calero
 
Mapfilterreducepresentation
MapfilterreducepresentationMapfilterreducepresentation
MapfilterreducepresentationManjuKumara GH
 
SQL on Hadoop - 12th Swiss Big Data User Group Meeting, 3rd of July, 2014, ET...
SQL on Hadoop - 12th Swiss Big Data User Group Meeting, 3rd of July, 2014, ET...SQL on Hadoop - 12th Swiss Big Data User Group Meeting, 3rd of July, 2014, ET...
SQL on Hadoop - 12th Swiss Big Data User Group Meeting, 3rd of July, 2014, ET...Romeo Kienzler
 
Oracle Rapid Home Provisioning 12.2
Oracle Rapid Home Provisioning 12.2Oracle Rapid Home Provisioning 12.2
Oracle Rapid Home Provisioning 12.2Daniele Massimi
 

Ähnlich wie Oracle Database 12.1.0.2 New Performance Features (20)

OracleDatabase12cPXNewFeatures_ITOUG_2018.pdf
OracleDatabase12cPXNewFeatures_ITOUG_2018.pdfOracleDatabase12cPXNewFeatures_ITOUG_2018.pdf
OracleDatabase12cPXNewFeatures_ITOUG_2018.pdf
 
Apache Lens at Hadoop meetup
Apache Lens at Hadoop meetupApache Lens at Hadoop meetup
Apache Lens at Hadoop meetup
 
IBM Pure Data System for Analytics (Netezza)
IBM Pure Data System for Analytics (Netezza)IBM Pure Data System for Analytics (Netezza)
IBM Pure Data System for Analytics (Netezza)
 
Scaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQLScaling PostgreSQL With GridSQL
Scaling PostgreSQL With GridSQL
 
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
Percona xtra db cluster(pxc) non blocking operations, what you need to know t...
 
Apache Sqoop: A Data Transfer Tool for Hadoop
Apache Sqoop: A Data Transfer Tool for HadoopApache Sqoop: A Data Transfer Tool for Hadoop
Apache Sqoop: A Data Transfer Tool for Hadoop
 
Functional Web Development
Functional Web DevelopmentFunctional Web Development
Functional Web Development
 
Hive
HiveHive
Hive
 
My SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please helpMy SYSAUX tablespace is full - please help
My SYSAUX tablespace is full - please help
 
Introduction to Apache Spark
Introduction to Apache SparkIntroduction to Apache Spark
Introduction to Apache Spark
 
Introduction to Mahout
Introduction to MahoutIntroduction to Mahout
Introduction to Mahout
 
Introduction to Mahout given at Twin Cities HUG
Introduction to Mahout given at Twin Cities HUGIntroduction to Mahout given at Twin Cities HUG
Introduction to Mahout given at Twin Cities HUG
 
High Throughput Analytics with Cassandra & Azure
High Throughput Analytics with Cassandra & AzureHigh Throughput Analytics with Cassandra & Azure
High Throughput Analytics with Cassandra & Azure
 
D3 d12 a-new-meaning-for-efficiency-and-performance
D3 d12 a-new-meaning-for-efficiency-and-performanceD3 d12 a-new-meaning-for-efficiency-and-performance
D3 d12 a-new-meaning-for-efficiency-and-performance
 
D3 d12 a-new-meaning-for-efficiency-and-performance
D3 d12 a-new-meaning-for-efficiency-and-performanceD3 d12 a-new-meaning-for-efficiency-and-performance
D3 d12 a-new-meaning-for-efficiency-and-performance
 
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
Evolution of Performance Management: Oracle 12c adaptive optimizations - ukou...
 
Mapfilterreducepresentation
MapfilterreducepresentationMapfilterreducepresentation
Mapfilterreducepresentation
 
SQL on Hadoop - 12th Swiss Big Data User Group Meeting, 3rd of July, 2014, ET...
SQL on Hadoop - 12th Swiss Big Data User Group Meeting, 3rd of July, 2014, ET...SQL on Hadoop - 12th Swiss Big Data User Group Meeting, 3rd of July, 2014, ET...
SQL on Hadoop - 12th Swiss Big Data User Group Meeting, 3rd of July, 2014, ET...
 
SQL on Hadoop
SQL on HadoopSQL on Hadoop
SQL on Hadoop
 
Oracle Rapid Home Provisioning 12.2
Oracle Rapid Home Provisioning 12.2Oracle Rapid Home Provisioning 12.2
Oracle Rapid Home Provisioning 12.2
 

Kürzlich hochgeladen

Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 

Kürzlich hochgeladen (20)

Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 

Oracle Database 12.1.0.2 New Performance Features

  • 1. 2014 © Trivadis BASEL BERN BRUGG LAUSANNE ZUERICH DUESSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA Oracle Database 12.1.0.2 New Performance Features DOAG 2014, Nürnberg (DE) Christian Antognini 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 1
  • 2. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 2 @ChrisAntognini Senior principal consultant, trainer and partner at Trivadis in Zurich (CH) christian.antognini@trivadis.com http://antognini.ch Focus: get the most out of Oracle Database Logical and physical database design Query optimizer Application performance management Author of Troubleshooting Oracle Performance (Apress, 2008/2014) OakTable Network, Oracle ACE Director
  • 3. 2014 © Trivadis 1.Zone Maps 2.Attribute Clustering 3.In-Memory Column Store 4.In-Memory Aggregation 5.Approximate Count Distinct 6.Automatic Big Table Caching 7.Full Database Caching 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 3 AGENDA
  • 4. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features Zone Maps 4
  • 5. 2014 © Trivadis A zone map is a redundant access structure associated to a table. At most one zone map per table can be created. Zone maps are intended to reduce the number of logical/physical I/O during table scans. Zone pruning Partition pruning Requirements to use zone maps: Oracle Partitioning option Exadata or Supercluster  19 November 2014 Oracle Database 12.1.0.2 New Performance Features 5 Zone Maps
  • 6. 2014 © Trivadis The target table is divided in zones. SYS_OP_ZONE_ID(ROWID,SCALE) A zone consists of a specific number of blocks. The SCALE attribute controls it #푏푙표푐푘푠=2푠푐푎푙푒 For every zone, the zone map stores the minimum and maximum values of several columns. 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 6 How Is a Zone Map Built and What Does It Contain? Zone 1 – Min 4 / Max 34 Zone 2 – Min 1 / Max 666 Zone 3 – Min 56 / Max 145 Zone 4 – Min 54 / Max 111 Zone 5 – Min 95 / Max 101
  • 7. 2014 © Trivadis A basic zone map stores information about the columns of a single table. A zone map is a materialized view with some particular properties. 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 7 Basic Zone Map CREATE MATERIALIZED ZONEMAP p_bzm ON p (id, n1, n2) SQL> SELECT object_type, object_name 2 FROM user_objects 3 WHERE object_name LIKE '%P_BZM'; OBJECT_TYPE OBJECT_NAME ----------------- ------------- MATERIALIZED VIEW P_BZM TABLE P_BZM INDEX I_ZMAP$_P_BZM
  • 8. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 8 Basic Zone Maps – Execution Plan SELECT count(*) FROM p WHERE n1 = 42 -------------------------------------------------------- | Id | Operation | Name | -------------------------------------------------------- | 0 | SELECT STATEMENT | | | 1 | SORT AGGREGATE | | |* 2 | TABLE ACCESS STORAGE FULL WITH ZONEMAP| P | -------------------------------------------------------- 2 - storage("N1"=42) filter((SYS_ZMAP_FILTER('/* ZM_PRUNING */ SELECT "ZONE_ID$", CASE WHEN BITAND(zm."ZONE_STATE$",1)=1 THEN 1 ELSE CASE WHEN (zm."MIN_2_N1" > :1 OR zm."MAX_2_N1" < :2) THEN 3 ELSE 2 END END FROM "CHRIS"."P_ZM" zm WHERE zm."ZONE_LEVEL$"=0 ORDER BY zm."ZONE_ID$"', SYS_OP_ZONE_ID(ROWID),42,42)<3 AND "N1"=42))
  • 9. 2014 © Trivadis A join zone map stores information about the columns of several tables. 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 9 Join Zone Maps CREATE MATERIALIZED ZONEMAP p_jzm AS SELECT sys_op_zone_id(p.rowid) AS zone_id$, min(p.n1) AS min_p_n1, max(p.n1) AS max_p_n1, min(p.n2) AS min_p_n2, max(p.n2) AS max_p_n2, min(c.n1) AS min_c_n1, max(c.n1) AS max_c_n1, min(c.n2) AS min_c_n2, max(c.n2) AS max_c_n2 FROM p LEFT OUTER JOIN c ON p.id = c.p_id GROUP BY sys_op_zone_id(p.rowid)
  • 10. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 10 Join Zone Maps – Execution Plan SELECT count(*) FROM p JOIN c ON p.id = c.p_id WHERE c.n2 = 42 --------------------------------------------------------- | Id | Operation | Name | --------------------------------------------------------- | 0 | SELECT STATEMENT | | | 1 | SORT AGGREGATE | | |* 2 | HASH JOIN | | |* 3 | TABLE ACCESS STORAGE FULL | C | |* 4 | TABLE ACCESS STORAGE FULL WITH ZONEMAP| P | --------------------------------------------------------- 2 - access("P"."ID"="C"."P_ID") 3 - storage("C"."N2"=42) filter("C"."N2"=42) 4 - filter(SYS_ZMAP_FILTER('/* ZM_PRUNING */ SELECT "ZONE_ID$", CASE WHEN BITAND(zm."ZONE_STATE$",1)=1 THEN 1 ELSE … )
  • 11. 2014 © Trivadis Zone maps are redundant access structures that are not always up-to-date. Basic zone maps: DML  selective invalidation Direct-path insert  automatic maintenance Join zone maps (created on the parent table): DML on parent  selective invalidation Direct-path insert on parent  automatic maintenance DML or direct-path insert on child  full invalidation 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 11 Staleness of Zone Maps
  • 12. 2014 © Trivadis To refresh a zone map two techniques are available: ALTER MATERIALIZED ZONEMAP REBUILD statement REFRESH procedure of DBMS_MVIEW package Complete as well as fast refreshes are available. 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 12 Refreshing Zone Maps
  • 13. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features Attribute Clustering 13
  • 14. 2014 © Trivadis Clustering data that is processed together is an old optimization technique. Index and hash clusters Heap table reorganization for improving the clustering factor of an important index Clustered data makes a number of features more effective B-tree index range scans Compression Exadata/In-Memory storage indexes Zone maps pruning 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 14 Clustering Data
  • 15. 2014 © Trivadis Attribute clustering is a new table directive that specifies on which column(s) data has to be clustered how data is ordered (linear, interleaved) when clustering takes place Keeping data clustered may be expensive. Therefore, the database engine doesn’t enforce it. It only takes place in case of direct-path inserts and data movement operations. 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 15 Attribute Clustering ALTER TABLE t CLUSTERING BY LINEAR ORDER (id) YES ON LOAD
  • 16. 2014 © Trivadis It’s also possible to cluster data based on column(s) of another table The joined table must have a PK or UK (ORA-65418) 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 16 Join Attribute Clustering CREATE TABLE p (id NUMBER, n NUMBER, pad VARCHAR2(100), CONSTRAINT p_pk PRIMARY KEY (id)) CREATE TABLE c (id NUMBER, p_id NUMBER, p_n NUMBER, pad VARCHAR2(100)) CLUSTERING c JOIN p ON (c.p_id = p.id) BY LINEAR ORDER (p.n)
  • 17. 2014 © Trivadis It is possible to combine attribute clustering with zone maps Both clustering and the zone map are based on the same columns 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 17 Attribute Clustering and Zone Maps CREATE TABLE c ( id NUMBER, p_id NUMBER, p_n NUMBER, pad VARCHAR2(100) ) CLUSTERING c JOIN p ON (c.p_id = p.id) BY LINEAR ORDER (p.n) WITH MATERIALIZED ZONEMAP (c_zm)
  • 18. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features In-Memory Aggregation 18
  • 19. 2014 © Trivadis To optimize queries against a star schema, the query optimizer should do the following: Start evaluating each dimension table that has restrictions on it. Assemble a list with the resulting dimension keys. Use this list to extract the matching rows from the fact table. This approach cannot be implemented with regular joins. The query optimizer can join only two data sets at one time. Joining two dimension tables leads to a Cartesian product. To solve this problem, Oracle Database implements two query transformations: Star transformation Vector transformation (new in 12.1.0.2 – requires the In-Memory option) 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 19 The Star Schema Challenge
  • 20. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 20 Star Transformation vs. Vector Transformation Selectivity Elapsed Time
  • 21. 2014 © Trivadis In the documentation Oracle refers to it as In-Memory Aggregation It isn’t only about aggregation It requires the In-Memory option because it takes advantage of some of its features INMEMORY_SIZE must be greater than 0 The query optimizer considers it when equijoins are used an aggregate function is applied to a column of the fact table the query contains a GROUP BY clause -ROLLUP, CUBE and GROUPING SETS are not yet supported 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 21 Vector Transformation (1)
  • 22. 2014 © Trivadis It’s a cost-based query transformation It can be controlled through the (NO_)VECTOR_TRANSFORM hints As with the star transformation, sometimes is not possible to force it It introduces new row source operations KEY VECTOR CREATE KEY VECTOR USE VECTOR GROUP BY 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 22 Vector Transformation (2)
  • 23. 2014 © Trivadis 1.For every dimension table with a filter on it the following operations take place Access table and filter data Create key vector Aggregate data Create temporary table 2.Access the fact table through a FTS and filter data by applying the key vectors On Exadata the filter is not yet offloaded 3.Aggregate data with either a vector or hash aggregation 4.Join data from the fact table to temporary tables 5.Join dimension tables without a filter on them 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 23 Vector Transformation – Processing Steps
  • 24. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 24 Example SELECT c.customer_class, sum(o.order_total) FROM orders o, customers c, warehouses w WHERE o.customer_id = c.customer_id AND o.warehouse_id = w.warehouse_id AND c.dob BETWEEN :b1 AND :b2 AND w.warehouse_name BETWEEN :b3 AND :b4 GROUP BY c.customer_class customers orders warehouses
  • 25. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 25 Execution Plan – Access Dimension Tables, Create Key Vectors, and Create Temporary Tables ------------------------------------------------------------------------- | Id | Operation | Name | ------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | | 1 | TEMP TABLE TRANSFORMATION | | | 2 | LOAD AS SELECT | SYS_TEMP_0FD9DE69C_28565764 | | 3 | VECTOR GROUP BY | | | 4 | KEY VECTOR CREATE BUFFERED | :KV0000 | |* 5 | TABLE ACCESS STORAGE FULL | CUSTOMERS | | 6 | LOAD AS SELECT | SYS_TEMP_0FD9DE69D_28565764 | | 7 | VECTOR GROUP BY | | | 8 | HASH GROUP BY | | | 9 | KEY VECTOR CREATE BUFFERED | :KV0001 | |* 10 | TABLE ACCESS STORAGE FULL | WAREHOUSES | ...
  • 26. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 26 Execution Plan – Access Fact Table by Applying Key Vectors, and Join Temporary Tables ... | 11 | HASH GROUP BY | | |* 12 | HASH JOIN | | | 13 | MERGE JOIN CARTESIAN | | | 14 | TABLE ACCESS STORAGE FULL | SYS_TEMP_0FD9DE69D_28565764 | | 15 | BUFFER SORT | | | 16 | TABLE ACCESS STORAGE FULL | SYS_TEMP_0FD9DE69C_28565764 | | 17 | VIEW | VW_VT_72AE2D8F | | 18 | VECTOR GROUP BY | | | 19 | HASH GROUP BY | | | 20 | KEY VECTOR USE | :KV0001 | | 21 | KEY VECTOR USE | :KV0000 | |* 22 | TABLE ACCESS STORAGE FULL| ORDERS | ------------------------------------------------------------------------- ... 22 - filter(SYS_OP_KEY_VECTOR_FILTER("O"."CUSTOMER_ID",:KV0000) AND SYS_OP_KEY_VECTOR_FILTER("O"."WAREHOUSE_ID",:KV0001))
  • 27. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features Approximate Count Distinct 27
  • 28. 2014 © Trivadis Computing the number of distinct values can be resource intensive In some situation performance is more important than precision Many algorithms that estimate the number of distinct values have been developed Oracle implemented one of this algorithms (HyperLogLog) In case an estimated number of distinct values is acceptable, you can replace COUNT(DISTINCT expr) with APPROX_COUNT_DISTINCT(expr) 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 28 APPROX_COUNT_DISTINCT Function
  • 29. 2014 © Trivadis 100’000’000 rows 12.7 GB 24 columns Number of distinct values is 2m, where 푚∈ℕ∗푚<25 Test queries 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 29 Test Case – Setup SELECT count(DISTINCT n_m) FROM t SELECT approx_count_distinct(n_m) FROM t
  • 30. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 30 Test Case – Elapsed Time 0 10 20 30 40 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 Elapsed Time [s] Number of Distinct Values COUNT(DISTINCT) APPROX_COUNT_DISTINCT()
  • 31. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 31 Test Case – PGA Utilization 1 10 100 1000 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 PGA [MB] Number of Distinct Values COUNT(DISTINCT) APPROX_COUNT_DISTINCT()
  • 32. 2014 © Trivadis 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 32 Test Case – Precision -4 -2 0 2 4 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536 131072 262144 524288 1048576 2097152 4194304 8388608 16777216 Error in Percent Number of Distinct Values
  • 33. 2014 © Trivadis Core Messages Zone Maps Interesting concept, but mostly useless because of licensing rule Attribute Clustering Declarative way to implement old but good technique for “load-once read-many” data In-Memory Aggregation Very interesting concept, complements the star transformation Approximate Count Distinct Useful feature, sound implementation 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 33
  • 34. 2014 © Trivadis Questions and answers ... BASEL BERN BRUGG LAUSANNE ZUERICH DUESSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MUNICH STUTTGART VIENNA Christian Antognini Principal Senior Consultant christian.antognini@trivadis.com 19 November 2014 Oracle Database 12.1.0.2 New Performance Features 34