SlideShare a Scribd company logo
Do’s and Don’ts of
Oracle Database In-Memory
Jorge Barba
Infrastructure Principal at Accenture Enkitec Group
https://jorgebarbablog.wordpress.com
Email: jorge.barba@accenture.com
Mar 2016
Agenda
2
A. Overview
B. Configuration
C. Optimizer
D. Queries
E. Usage with Oracle Technologies
F. Do's and Don'ts
G. Conclusion
Overview
4
Database In-Memory
In-Memory Column Store is an optional,
static SGA pool that stores segments in
columnar format.
It is a supplement to the Buffer Cache.
The database keeps the columnar data
transactionally consistent with the Buffer
Cache.
5
Row Format vs. Column Format
Transactions run faster on row format
Example: Query or Insert a sales order
Fast processing a few rows, many columns.
Analytics run faster on column format
Example: Report on sales totals by region
Fast accessing few columns, many rows
6
Dual Format Database
Same table on both formats
Analytics use the new in-memory Column Format
OLTP uses the Row Format
7
Scanning Memory
Buffer Cache
Have to walk along that row until we find
col4.
IM Column Store
Go directly to the col4 structure and scan
all the entries.
8
Storage Index
Storage Indexes
Automatically created and maintained
for each column in the Column Store.
Allow data pruning based on filter
predicates in the SQL statement.
Keeps track of minimum and maximum
values for each column in an IMCU.
If the column value is outside the
minimum and maximum range for an
IMCU, the scan of that IMCU is
avoided.
9
In-Memory Join and Bloom Filter (BF)
•  A Bloom filter transforms a join into a filter that can be
applied as part of the scan of the larger table.
•  Very efficiently applied to column format data via SIMD
vector processing.
•  Appears in two places, at creation time and again
when it is applied.
SELECT count(*)
FROM lineorder lo, part p
WHERE lo.lo_partkey=p.p_partkey
AND lo.lo_shipmode='TRUCK'
AND lo.lo_ordtotalprice between
55000000 and 56000000
AND p.p_name='papaya burlywood’;
10
Vector Group By
•  New optimizer transformation introduced with Oracle 12.1.0.2.0.
•  Find the total sales of footwear products in outlet stores.
•  The combination of these two phases dramatically improves the efficiency of a
multiple table join with complex aggregations.
| 9 | KEY VECTOR (USE) | :KV0000
| 10 | KEY VECTOR (USE) | :KV0001
11
SIMD Single Instruction Multiple Data
SIMD
A set of column values are evaluated together in a
single CPU instruction.
Designed to maximize the number of column
entries loaded and evaluated in a single CPU
instruction.
8 entries are loaded into the register for evaluation.
Configuration
13
Configuring the In-Memory Column Store
Configuration
•  INMEMORY_SIZE=1520M
•  Minimum of 100M
•  Part of the SGA
•  Fixed size
SQL> select * from v$sga;
NAME VALUE
-------------------- ----------
Fixed Size 2932632
Variable Size 587202664
Database Buffers 2097152000
Redo Buffers 13844480
In-Memory Area 1593835520
alter system set inmemory_size=1520M scope=spfile;
shutdown immediate;
startup
14
Populating the In-Memory Column Store
ALTER TABLE lineorder INMEMORY;
ALTER TABLE lineorder NO INMEMORY;
CREATE TABLE customer …
PARTITION BY LIST
(PARTITION p1 …… INMEMORY,
PARTITION p2 …… NO INMEMORY);
Eligible segments are:
•  Tables
•  Partitions
•  Subpartitions
•  Materialized Views
Not supported:
•  IOTs, Hash clusters, Out of line
LOBs.
15
Composition of In-Memory Area and DML
SQL> select pool, alloc_bytes
2 from v$inmemory_area;
POOL ALLOC_BYTES
-------------- -----------
1MB POOL 1274019840
64KB POOL 301989888
16
Composition of In-Memory Area and DML
•  Bulk Data Loads
•  Typically conducted as a direct path load.
•  The size of the missing data will be visible in
the BYTES_NOT_POPULATED column (V
$IM_SEGMENTS).
•  Partition Exchange Loads
•  Partition big tables or fact tables.
•  Transaction Processing
•  Single row data change operations (DML)
execute via the Buffer Cache.
17
Repopulation

•  Oracle Database will repopulate an IMCU when the
number of entries reaches a threshold.
•  Repopulation is more frequent for IMCUs that are
accessed frequently or have higher percentage of stale
rows.
•  Also the IMCO background process may also
repopulate.
18
Overhead

•  Keeping the IM Column Store
transactionally consistent.
•  Rate of change, compression level,
location of the changed rows, type of
operations being performed.
Optimizer
20
Optimizer
1.  In 12c the optimizer is fully aware of the In-
Memory Column Store. This means that the
optimizer will cost the read from the In-
memory Column Store.
2.  Using the same statistics and also new In-
Memory statistics
21
Optimizer 10053 trace
SELECT /* opt_trace_test */ sum(lo_revenue)
FROM lineorder lo, customer c
WHERE lo.lo_custkey=c.c_custkey
AND c_region='AFRICA';
column sql_text format a30
select sql_id, child_number,
sql_text from v$sql
where sql_text like
'%opt_trace_test%';
SQL_ID
-------------
5b8n5m6gtx71r
22
Optimizer 10053 trace (cont)
alter session set max_dump_file_size = unlimited;
execute DBMS_SQLDIAG.DUMP_TRACE(-
p_sql_id='5b8n5m6gtx71r', -
p_child_number=0, -
p_component='Optimizer', -
p_file_id='TRACE_10053');
How to Obtain Tracing of Optimizer Computations (EVENT 10053) (Doc ID 225598.1)
col value format a90
SELECT value
FROM v$diag_info
WHERE name='Default Trace File';
VALUE
---------------------------------------------------------------------------------------
/u01/app/oracle/diag/rdbms/db_inst2/DBNAME/trace/DB_INST2_ora_130114_TRACE_10053.trc
23
Optimizer 10053 trace (cont)
***************************************
BASE STATISTICAL INFORMATION
***********************
Table Stats::
Table: CUSTOMER Alias: C
#Rows: 120000 SSZ: 0 LGR: 0 #Blks: 1882 AvgRowLen: 107.00 NEB: 0 ChainCnt:
0.00 SPC: 0 RFL: 0 RNF: 0 CBK: 0 CHR: 0 KQDFLG: 1
#IMCUs: 1 IMCRowCnt: 120000 IMCJournalRowCnt: 3000 #IMCBlocks: 0 IMCQuotient:
1.000000
Column (#1): C_CUSTKEY(NUMBER)
AvgLen: 5 NDV: 120000 Nulls: 0 Density: 0.000008 Min: 1.000000 Max: 120000.000000
***********************
Table Stats::
Table: LINEORDER Alias: LO
#Rows: 23996670 SSZ: 0 LGR: 0 #Blks: 335060 AvgRowLen: 96.00 NEB: 0 ChainCnt:
0.00 SPC: 0 RFL: 0 RNF: 0 CBK: 0 CHR: 0 KQDFLG: 1
#IMCUs: 23 IMCRowCnt: 23996670 IMCJournalRowCnt: 599917 #IMCBlocks: 0
IMCQuotient: 1.000000
Column (#3): LO_CUSTKEY(NUMBER)
AvgLen: 5 NDV: 80504 Nulls: 0 Density: 0.000012 Min: 1.000000 Max: 119999.000000
24
Disabling and Enabling In-Memory
To disable In-Memory scans set the parameter
INMEMORY_QUERY = DISABLE
Plans will get the cost based on disk statistics and scans will be from the IM Column Store.
Use hint INMEMORY to force In-Memory Scan even if INMEMORY_QUERY is disabled.
NO_INMEMORY disables In-Memory scan even if the table is in the In-Memory Column Store.
SELECT /*+ INMEMORY */ sum(lo_revenue)
FROM lineorder lo, customer c
WHERE lo.lo_custkey=c.c_custkey
AND c_region='AFRICA’;
SELECT /*+ NO_INMEMORY */ sum(lo_revenue)
FROM lineorder lo, customer c
WHERE lo.lo_custkey=c.c_custkey
AND c_region='AFRICA’;
25
Optimizer Summary
•  In 12.1.0.2 the Optimizer is In-Memory aware.
•  In-Memory statistics automatically generated at parse.
•  Cost model adjusted for costing In-Memory Scans
•  New INMEMORY and NO_INMEMORY hints
Queries
27
Queries
•  We have chosen some of the
queries that are candidates to
benefit from Database In-
Memory.
28
Function MAX(column)
select max(lo_ordtotalprice)
from lineorder;
MAX(LO_ORDTOTALPRICE)
---------------------
55903140
Elapsed time: 0.004
select /*+ NO_INMEMORY */
max(lo_ordtotalprice)
from lineorder;
MAX(LO_ORDTOTALPRICE)
---------------------
55903140
Elapsed time: 4.014
29
Function MAX(column)
B-tree index on lo_ordtotalprice
create index ordtotalprice_ix on
lineorder(lo_ordtotalprice);
select /*+ NO_INMEMORY */
max(lo_ordtotalprice)
from lineorder;
MAX(LO_ORDTOTALPRICE)
---------------------
55903140
Elapsed time: 0.001
30
Function MAX(column)
How about Result Cache?
SQL show parameter result_cache_max_size
big integer 22000K
select /*+ RESULT_CACHE */
max(lo_ordtotalprice)
from lineorder;
MAX(LO_ORDTOTALPRICE)
---------------------
55903140
Elapsed time: 0.001
31
How do we know it used the In-Memory Column Store?
select n.name, s.value
from v$mystat s, v$statname n
where s.statistic#=n.statistic#
and n.name like 'IM scan CUs columns accessed';
-----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 3 | 2224 (12)| 00:00:01 |
| 1 | SORT AGGREGATE | | 1 | 3 | | |
| 2 | TABLE ACCESS INMEMORY FULL| LINEORDER | 24M| 68M| 2224 (12)| 00:00:01 |
-----------------------------------------------------------------------------------------
NAME VALUE
---------------------------------------------------------------- ----------
IM scan CUs columns accessed 45
32
One equality predicate
SELECT lo_orderkey,
lo_custkey, lo_revenue
FROM lineorder
WHERE lo_orderkey = 4000000;
LO_ORDERKEY LO_CUSTKEY LO_REVENUE
----------- ----------- -----------
4000000 51832 6983797
4000000 51832 917952
4000000 51832 2501733
4000000 51832 7895007
Elapsed time: 0.002
SELECT /*+ NO_INMEMORY */
lo_orderkey, lo_custkey,
lo_revenue
FROM lineorder
WHERE lo_orderkey = 4000000;
LO_ORDERKEY LO_CUSTKEY LO_REVENUE
----------- ----------- -----------
4000000 51832 6983797
4000000 51832 917952
4000000 51832 2501733
4000000 51832 7895007
Elapsed time: 4.528
IM scan CUs columns accessed 3
IM scan segments minmax eligible 44
IM scan CUs pruned 43
33
One equality predicate
B-tree index on lo_orderkey
create index lo_orderkey_ix
on lineorder (lo_orderkey);
SELECT /*+ NO_INMEMORY */
lo_orderkey, lo_custkey,
lo_revenue
FROM lineorder
WHERE lo_orderkey = 4000000;
LO_ORDERKEY LO_CUSTKEY LO_REVENUE
----------- ----------- -----------
4000000 51832 6983797
4000000 51832 917952
4000000 51832 2501733
4000000 51832 7895007
Elapsed time: 0.001
34
Three equality predicate
SELECT lo_orderkey, lo_custkey, lo_revenue
FROM lineorder
WHERE lo_custkey = 13286
AND lo_shipmode = 'TRUCK’
AND lo_orderpriority = '3-MEDIUM’;
LO_ORDERKEY LO_CUSTKEY LO_REVENUE
----------- ----------- -----------
8268262 13286 6777268
8268262 13286 6207689
9048868 13286 6394887
17521920 13286 2905822
19397281 13286 3573400
Elapsed time: 0.002
SELECT /*+ NO_INMEMORY */ lo_orderkey,
lo_custkey, lo_revenue
FROM lineorder
WHERE lo_custkey = 13286
AND lo_shipmode = 'TRUCK’
AND lo_orderpriority = '3-MEDIUM’;
LO_ORDERKEY LO_CUSTKEY LO_REVENUE
----------- ----------- -----------
8268262 13286 6777268
8268262 13286 6207689
9048868 13286 6394887
17521920 13286 2905822
19397281 13286 3573400
Elapsed time: 4.868
IM scan CUs columns accessed 3
IM scan segments minmax eligible 44
IM scan CUs pruned 43
35
How about composite index?
create index cust_ship_pri_ix
on lineorder
(lo_custkey, lo_shipmode,
lo_orderpriority);
SELECT /*+ NO_INMEMORY */ lo_orderkey,
lo_custkey, lo_revenue
FROM lineorder
WHERE lo_custkey = 13286
AND lo_shipmode = 'TRUCK’
AND lo_orderpriority = '3-MEDIUM’;
Customer#000118324 JORDAN
Customer#000119371 ETHIOPIA
Customer#000119386 SAUDI ARABIA
Customer#000118412
VIETNAMLO_ORDERKEY LO_CUSTKEY LO_REVENUE
----------- ----------- -----------
8268262 13286 6777268
8268262 13286 6207689
9048868 13286 6394887
17521920 13286 2905822
19397281 13286 3573400
Elapsed time: 0.001
36
Greater Than () Instead of Equality (=)
SELECT MAX(lo_ordtotalprice)
FROM lineorder
WHERE lo_quantity  74;
Elapsed time: 0.002
SELECT MAX(lo_ordtotalprice)
FROM lineorder
WHERE lo_quantity  74;
Elapsed time: 4.82
IM scan CUs columns accessed 3
IM scan segments minmax eligible 44
IM scan CUs pruned 43
37
How about an index?
create index lo_quantity_ix on
lineorder(lo_quantity);
SELECT /*+ INDEX(a lo_quantity_ix) */
MAX(lo_ordtotalprice)
FROM lineorder a
WHERE lo_quantity  74;
Elapsed time: 0.001
38
Bloom Filter Example
SELECT c.c_name, c.c_nation
FROM customer c, part p,
lineorder lo
WHERE lo.lo_custkey = c.c_custkey
AND lo.lo_partkey = p.p_partkey
AND p.p_name = 'white salmon';
C_NAME C_NATION
------------------------- ---------------
Customer#000118324 JORDAN
Customer#000119371 ETHIOPIA
Customer#000119386 SAUDI ARABIA
Customer#000118412 VIETNAM
...
...
39
Vector Group By Example
SELECT /*+ VECTOR_TRANSFORM */
c.c_name, c.c_nation,
sum(lo_ordtotalprice)
FROM customer c, part p,
lineorder lo
WHERE lo.lo_custkey = c.c_custkey
AND lo.lo_partkey = p.p_partkey
AND p.p_name = 'white salmon'
group by c.c_name, c.c_nation;
...
...
C_NAME C_NATION SUM(LO_ORDTOTALPRICE)
------------------------- --------------- ---------------------
Customer#000118540 ROMANIA 12634439
Customer#000119051 ARGENTINA 28032775
Customer#000118129 JAPAN 22258279
Customer#000118198 UNITED STATES 17849279
Usage with Oracle Technologies
41
RAC
Each node in a RAC environment has its own IM
column store.
Objects populated into memory will be
distributed across all of the IM column stores in
the cluster.
ALTER TABLE lineorder INMEMORY
DISTRIBUTE BY PARTITION;
ALTER TABLE lineorder INMEMORY
DISTRIBUTE AUTO DUPLICATE ALL;
42
M6-32
M6-32
SMP removes the overhead of distributing
queries across a cluster and coordinating
transactions.
Algorithms NUMA optimized.
Memory interconnect far faster than any
network.
43
Exadata
Exadata
Complete fault-tolerant In-Memory
solution.
Exceed DRAM limits and transparently
scale across Memory, Flash and Disk.
Initial population of data into the In-
Memory column store from storage is very
fast.
The In-Memory Aggregation optimization,
can be offloaded to Exadata storage cells
44
Oracle Technologies
•  Data Guard
•  Golden Gate
•  Oracle Multitenant
•  Partitioning
•  Parallelism
•  Resource Manager
•  RMAN
•  ALTER TABLE EXCHANGE
45
Partition Exchange
1.  Create external table for flat files
2.  Use CTAS to create non part table and
gather table stats
3.  Set INMEMORY attribute ON
4.  Populate non part table in column store
5.  Alter table table_name exchange partition
part name with table non part table;
Do’s and Don’ts
47
The benefits of IM Column Store
Speed up Scans, Joins, Aggregates.
Scan of large tables and using predicates like =, , , IN
Querying a subset of columns in a table, for example, selecting 5 of 100 columns.
Accelerating joins by converting predicates on small dimension tables into filters on a large
fact table.
48
Do or Don’t?
Business applications
Ad-hoc analytic queries
Data warehouse workloads
49
Do or Don’t?
OLTP databases
short transactions
using index lookups
50
Do
Queries that scan a large number of rows and apply filters that use operators such as the
following: =, , , and IN.
Queries that select a small number of columns from a table or materialized view with a
large number of columns, such as a query that selects five columns from a table with 100
columns.
Queries that join a small table to a large table.
Queries that aggregate data.
51
Don’t
Queries with complex predicates.
Queries that select a large number of columns.
Queries that return a large number of rows.
Queries with multiple large table joins.
52
Don’t
In-memory speeds up analytic data access, not:
Network round trips, logon/logoff
Parsing, PL/SQL, complex functions
Data processing (as opposed to access)
Complex joins or aggregations where not much data is filtered before processing
Load and select once - Staging tables, ETL, temp tables
Is it for me?
Conclusion
54
KEEP
CALM
AND
ASK
ME
Tú Pregúntame …
Please visit my blog at:
https://jorgebarbablog.wordpress.com
Email: jorge.barba@accenture.com

More Related Content

What's hot

DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4Pranav Prakash
 
InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)
I Goo Lee.
 
What's New In MySQL 5.6
What's New In MySQL 5.6What's New In MySQL 5.6
What's New In MySQL 5.6Abdul Manaf
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
MariaDB plc
 
DB2 utilities
DB2 utilitiesDB2 utilities
DB2 utilities
Udayakumar Suseendran
 
M|18 Understanding the Query Optimizer
M|18 Understanding the Query OptimizerM|18 Understanding the Query Optimizer
M|18 Understanding the Query Optimizer
MariaDB plc
 
12c SQL Plan Directives
12c SQL Plan Directives12c SQL Plan Directives
12c SQL Plan Directives
Franck Pachot
 
Query Optimizer in MariaDB 10.4
Query Optimizer in MariaDB 10.4Query Optimizer in MariaDB 10.4
Query Optimizer in MariaDB 10.4
Sergey Petrunya
 
ALTER TABLE Improvements in MariaDB Server
ALTER TABLE Improvements in MariaDB ServerALTER TABLE Improvements in MariaDB Server
ALTER TABLE Improvements in MariaDB Server
MariaDB plc
 
Btree. Explore the heart of PostgreSQL.
Btree. Explore the heart of PostgreSQL. Btree. Explore the heart of PostgreSQL.
Btree. Explore the heart of PostgreSQL.
Anastasia Lubennikova
 
MariaDB ColumnStore
MariaDB ColumnStoreMariaDB ColumnStore
MariaDB ColumnStore
MariaDB plc
 
PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6
Tomas Vondra
 
Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)Chris Adkin
 
Юра Гуляев. Oracle tables
Юра Гуляев. Oracle tablesЮра Гуляев. Oracle tables
Юра Гуляев. Oracle tables
Aleksandr Motsjonov
 
DB2UDB_the_Basics Day 6
DB2UDB_the_Basics Day 6DB2UDB_the_Basics Day 6
DB2UDB_the_Basics Day 6Pranav Prakash
 
An introduction to column store indexes and batch mode
An introduction to column store indexes and batch modeAn introduction to column store indexes and batch mode
An introduction to column store indexes and batch mode
Chris Adkin
 
DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5Pranav Prakash
 
CBO choice between Index and Full Scan: the good, the bad and the ugly param...
CBO choice between Index and Full Scan:  the good, the bad and the ugly param...CBO choice between Index and Full Scan:  the good, the bad and the ugly param...
CBO choice between Index and Full Scan: the good, the bad and the ugly param...
Franck Pachot
 
Using histograms to get better performance
Using histograms to get better performanceUsing histograms to get better performance
Using histograms to get better performance
Sergey Petrunya
 
Performance improvements in PostgreSQL 9.5 and beyond
Performance improvements in PostgreSQL 9.5 and beyondPerformance improvements in PostgreSQL 9.5 and beyond
Performance improvements in PostgreSQL 9.5 and beyond
Tomas Vondra
 

What's hot (20)

DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4DB2UDB_the_Basics Day 4
DB2UDB_the_Basics Day 4
 
InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)InnoDB MVCC Architecture (by 권건우)
InnoDB MVCC Architecture (by 권건우)
 
What's New In MySQL 5.6
What's New In MySQL 5.6What's New In MySQL 5.6
What's New In MySQL 5.6
 
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
What's New in MariaDB Server 10.2 and MariaDB MaxScale 2.1
 
DB2 utilities
DB2 utilitiesDB2 utilities
DB2 utilities
 
M|18 Understanding the Query Optimizer
M|18 Understanding the Query OptimizerM|18 Understanding the Query Optimizer
M|18 Understanding the Query Optimizer
 
12c SQL Plan Directives
12c SQL Plan Directives12c SQL Plan Directives
12c SQL Plan Directives
 
Query Optimizer in MariaDB 10.4
Query Optimizer in MariaDB 10.4Query Optimizer in MariaDB 10.4
Query Optimizer in MariaDB 10.4
 
ALTER TABLE Improvements in MariaDB Server
ALTER TABLE Improvements in MariaDB ServerALTER TABLE Improvements in MariaDB Server
ALTER TABLE Improvements in MariaDB Server
 
Btree. Explore the heart of PostgreSQL.
Btree. Explore the heart of PostgreSQL. Btree. Explore the heart of PostgreSQL.
Btree. Explore the heart of PostgreSQL.
 
MariaDB ColumnStore
MariaDB ColumnStoreMariaDB ColumnStore
MariaDB ColumnStore
 
PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6PostgreSQL performance improvements in 9.5 and 9.6
PostgreSQL performance improvements in 9.5 and 9.6
 
Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)Column store indexes and batch processing mode (nx power lite)
Column store indexes and batch processing mode (nx power lite)
 
Юра Гуляев. Oracle tables
Юра Гуляев. Oracle tablesЮра Гуляев. Oracle tables
Юра Гуляев. Oracle tables
 
DB2UDB_the_Basics Day 6
DB2UDB_the_Basics Day 6DB2UDB_the_Basics Day 6
DB2UDB_the_Basics Day 6
 
An introduction to column store indexes and batch mode
An introduction to column store indexes and batch modeAn introduction to column store indexes and batch mode
An introduction to column store indexes and batch mode
 
DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5DB2UDB_the_Basics Day 5
DB2UDB_the_Basics Day 5
 
CBO choice between Index and Full Scan: the good, the bad and the ugly param...
CBO choice between Index and Full Scan:  the good, the bad and the ugly param...CBO choice between Index and Full Scan:  the good, the bad and the ugly param...
CBO choice between Index and Full Scan: the good, the bad and the ugly param...
 
Using histograms to get better performance
Using histograms to get better performanceUsing histograms to get better performance
Using histograms to get better performance
 
Performance improvements in PostgreSQL 9.5 and beyond
Performance improvements in PostgreSQL 9.5 and beyondPerformance improvements in PostgreSQL 9.5 and beyond
Performance improvements in PostgreSQL 9.5 and beyond
 

Viewers also liked

Memory Management for High-Performance Applications
Memory Management for High-Performance ApplicationsMemory Management for High-Performance Applications
Memory Management for High-Performance Applications
Emery Berger
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
rprajat007
 
Accenture at Oracle OpenWorld 2015
Accenture at Oracle OpenWorld 2015Accenture at Oracle OpenWorld 2015
Accenture at Oracle OpenWorld 2015
Accenture Technology
 
Deep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache SparkDeep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache Spark
Databricks
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
Akmal Cikmat
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
Dr. Loganathan R
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
guest1415ae65
 
The New Energy Consumer: What Promises Do Blockchain Technologies Offer Energ...
The New Energy Consumer: What Promises Do Blockchain Technologies Offer Energ...The New Energy Consumer: What Promises Do Blockchain Technologies Offer Energ...
The New Energy Consumer: What Promises Do Blockchain Technologies Offer Energ...
accenture
 

Viewers also liked (8)

Memory Management for High-Performance Applications
Memory Management for High-Performance ApplicationsMemory Management for High-Performance Applications
Memory Management for High-Performance Applications
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Accenture at Oracle OpenWorld 2015
Accenture at Oracle OpenWorld 2015Accenture at Oracle OpenWorld 2015
Accenture at Oracle OpenWorld 2015
 
Deep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache SparkDeep Dive: Memory Management in Apache Spark
Deep Dive: Memory Management in Apache Spark
 
Operating System-Memory Management
Operating System-Memory ManagementOperating System-Memory Management
Operating System-Memory Management
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Operating Systems and Memory Management
Operating Systems and Memory ManagementOperating Systems and Memory Management
Operating Systems and Memory Management
 
The New Energy Consumer: What Promises Do Blockchain Technologies Offer Energ...
The New Energy Consumer: What Promises Do Blockchain Technologies Offer Energ...The New Energy Consumer: What Promises Do Blockchain Technologies Offer Energ...
The New Energy Consumer: What Promises Do Blockchain Technologies Offer Energ...
 

Similar to Oracle Database InMemory

Top 10 tips for Oracle performance
Top 10 tips for Oracle performanceTop 10 tips for Oracle performance
Top 10 tips for Oracle performance
Guy Harrison
 
Oracle Database In-Memory Option for ILOUG
Oracle Database In-Memory Option for ILOUGOracle Database In-Memory Option for ILOUG
Oracle Database In-Memory Option for ILOUG
Zohar Elkayam
 
Oracle Query Optimizer - An Introduction
Oracle Query Optimizer - An IntroductionOracle Query Optimizer - An Introduction
Oracle Query Optimizer - An Introduction
adryanbub
 
Sql server scalability fundamentals
Sql server scalability fundamentalsSql server scalability fundamentals
Sql server scalability fundamentals
Chris Adkin
 
Oracle Database In-Memory Option in Action
Oracle Database In-Memory Option in ActionOracle Database In-Memory Option in Action
Oracle Database In-Memory Option in Action
Tanel Poder
 
In Memory Database In Action by Tanel Poder and Kerry Osborne
In Memory Database In Action by Tanel Poder and Kerry OsborneIn Memory Database In Action by Tanel Poder and Kerry Osborne
In Memory Database In Action by Tanel Poder and Kerry Osborne
Enkitec
 
Advanced MySQL Query Optimizations
Advanced MySQL Query OptimizationsAdvanced MySQL Query Optimizations
Advanced MySQL Query Optimizations
Dave Stokes
 
How to make data available for analytics ASAP
How to make data available for analytics ASAPHow to make data available for analytics ASAP
How to make data available for analytics ASAP
MariaDB plc
 
embedded C.pptx
embedded C.pptxembedded C.pptx
embedded C.pptx
mohammedahmed539376
 
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL ServerGeek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
IDERA Software
 
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
Dave Stokes
 
Performance Tuning
Performance TuningPerformance Tuning
Performance Tuning
Ligaya Turmelle
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Ronald Francisco Vargas Quesada
 
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
Dave Stokes
 
Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016
Niko Neugebauer
 
Cost Based Optimizer - Part 1 of 2
Cost Based Optimizer - Part 1 of 2Cost Based Optimizer - Part 1 of 2
Cost Based Optimizer - Part 1 of 2
Mahesh Vallampati
 
M|18 Ingesting Data with the New Bulk Data Adapters
M|18 Ingesting Data with the New Bulk Data AdaptersM|18 Ingesting Data with the New Bulk Data Adapters
M|18 Ingesting Data with the New Bulk Data Adapters
MariaDB plc
 
Debunking myths about_redo_ppt
Debunking myths about_redo_pptDebunking myths about_redo_ppt
Debunking myths about_redo_ppt
Riyaj Shamsudeen
 
Sql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ramSql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ramChris Adkin
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organization
AmrutaMehata
 

Similar to Oracle Database InMemory (20)

Top 10 tips for Oracle performance
Top 10 tips for Oracle performanceTop 10 tips for Oracle performance
Top 10 tips for Oracle performance
 
Oracle Database In-Memory Option for ILOUG
Oracle Database In-Memory Option for ILOUGOracle Database In-Memory Option for ILOUG
Oracle Database In-Memory Option for ILOUG
 
Oracle Query Optimizer - An Introduction
Oracle Query Optimizer - An IntroductionOracle Query Optimizer - An Introduction
Oracle Query Optimizer - An Introduction
 
Sql server scalability fundamentals
Sql server scalability fundamentalsSql server scalability fundamentals
Sql server scalability fundamentals
 
Oracle Database In-Memory Option in Action
Oracle Database In-Memory Option in ActionOracle Database In-Memory Option in Action
Oracle Database In-Memory Option in Action
 
In Memory Database In Action by Tanel Poder and Kerry Osborne
In Memory Database In Action by Tanel Poder and Kerry OsborneIn Memory Database In Action by Tanel Poder and Kerry Osborne
In Memory Database In Action by Tanel Poder and Kerry Osborne
 
Advanced MySQL Query Optimizations
Advanced MySQL Query OptimizationsAdvanced MySQL Query Optimizations
Advanced MySQL Query Optimizations
 
How to make data available for analytics ASAP
How to make data available for analytics ASAPHow to make data available for analytics ASAP
How to make data available for analytics ASAP
 
embedded C.pptx
embedded C.pptxembedded C.pptx
embedded C.pptx
 
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL ServerGeek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
 
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
MySQL 8 -- A new beginning : Sunshine PHP/PHP UK (updated)
 
Performance Tuning
Performance TuningPerformance Tuning
Performance Tuning
 
Presentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12cPresentación Oracle Database Migración consideraciones 10g/11g/12c
Presentación Oracle Database Migración consideraciones 10g/11g/12c
 
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
 
Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016Columnstore improvements in SQL Server 2016
Columnstore improvements in SQL Server 2016
 
Cost Based Optimizer - Part 1 of 2
Cost Based Optimizer - Part 1 of 2Cost Based Optimizer - Part 1 of 2
Cost Based Optimizer - Part 1 of 2
 
M|18 Ingesting Data with the New Bulk Data Adapters
M|18 Ingesting Data with the New Bulk Data AdaptersM|18 Ingesting Data with the New Bulk Data Adapters
M|18 Ingesting Data with the New Bulk Data Adapters
 
Debunking myths about_redo_ppt
Debunking myths about_redo_pptDebunking myths about_redo_ppt
Debunking myths about_redo_ppt
 
Sql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ramSql server engine cpu cache as the new ram
Sql server engine cpu cache as the new ram
 
Computer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organizationComputer Organization : CPU, Memory and I/O organization
Computer Organization : CPU, Memory and I/O organization
 

Recently uploaded

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 

Recently uploaded (20)

Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 

Oracle Database InMemory

  • 1. Do’s and Don’ts of Oracle Database In-Memory Jorge Barba Infrastructure Principal at Accenture Enkitec Group https://jorgebarbablog.wordpress.com Email: jorge.barba@accenture.com Mar 2016
  • 2. Agenda 2 A. Overview B. Configuration C. Optimizer D. Queries E. Usage with Oracle Technologies F. Do's and Don'ts G. Conclusion
  • 4. 4 Database In-Memory In-Memory Column Store is an optional, static SGA pool that stores segments in columnar format. It is a supplement to the Buffer Cache. The database keeps the columnar data transactionally consistent with the Buffer Cache.
  • 5. 5 Row Format vs. Column Format Transactions run faster on row format Example: Query or Insert a sales order Fast processing a few rows, many columns. Analytics run faster on column format Example: Report on sales totals by region Fast accessing few columns, many rows
  • 6. 6 Dual Format Database Same table on both formats Analytics use the new in-memory Column Format OLTP uses the Row Format
  • 7. 7 Scanning Memory Buffer Cache Have to walk along that row until we find col4. IM Column Store Go directly to the col4 structure and scan all the entries.
  • 8. 8 Storage Index Storage Indexes Automatically created and maintained for each column in the Column Store. Allow data pruning based on filter predicates in the SQL statement. Keeps track of minimum and maximum values for each column in an IMCU. If the column value is outside the minimum and maximum range for an IMCU, the scan of that IMCU is avoided.
  • 9. 9 In-Memory Join and Bloom Filter (BF) •  A Bloom filter transforms a join into a filter that can be applied as part of the scan of the larger table. •  Very efficiently applied to column format data via SIMD vector processing. •  Appears in two places, at creation time and again when it is applied. SELECT count(*) FROM lineorder lo, part p WHERE lo.lo_partkey=p.p_partkey AND lo.lo_shipmode='TRUCK' AND lo.lo_ordtotalprice between 55000000 and 56000000 AND p.p_name='papaya burlywood’;
  • 10. 10 Vector Group By •  New optimizer transformation introduced with Oracle 12.1.0.2.0. •  Find the total sales of footwear products in outlet stores. •  The combination of these two phases dramatically improves the efficiency of a multiple table join with complex aggregations. | 9 | KEY VECTOR (USE) | :KV0000 | 10 | KEY VECTOR (USE) | :KV0001
  • 11. 11 SIMD Single Instruction Multiple Data SIMD A set of column values are evaluated together in a single CPU instruction. Designed to maximize the number of column entries loaded and evaluated in a single CPU instruction. 8 entries are loaded into the register for evaluation.
  • 13. 13 Configuring the In-Memory Column Store Configuration •  INMEMORY_SIZE=1520M •  Minimum of 100M •  Part of the SGA •  Fixed size SQL> select * from v$sga; NAME VALUE -------------------- ---------- Fixed Size 2932632 Variable Size 587202664 Database Buffers 2097152000 Redo Buffers 13844480 In-Memory Area 1593835520 alter system set inmemory_size=1520M scope=spfile; shutdown immediate; startup
  • 14. 14 Populating the In-Memory Column Store ALTER TABLE lineorder INMEMORY; ALTER TABLE lineorder NO INMEMORY; CREATE TABLE customer … PARTITION BY LIST (PARTITION p1 …… INMEMORY, PARTITION p2 …… NO INMEMORY); Eligible segments are: •  Tables •  Partitions •  Subpartitions •  Materialized Views Not supported: •  IOTs, Hash clusters, Out of line LOBs.
  • 15. 15 Composition of In-Memory Area and DML SQL> select pool, alloc_bytes 2 from v$inmemory_area; POOL ALLOC_BYTES -------------- ----------- 1MB POOL 1274019840 64KB POOL 301989888
  • 16. 16 Composition of In-Memory Area and DML •  Bulk Data Loads •  Typically conducted as a direct path load. •  The size of the missing data will be visible in the BYTES_NOT_POPULATED column (V $IM_SEGMENTS). •  Partition Exchange Loads •  Partition big tables or fact tables. •  Transaction Processing •  Single row data change operations (DML) execute via the Buffer Cache.
  • 17. 17 Repopulation •  Oracle Database will repopulate an IMCU when the number of entries reaches a threshold. •  Repopulation is more frequent for IMCUs that are accessed frequently or have higher percentage of stale rows. •  Also the IMCO background process may also repopulate.
  • 18. 18 Overhead •  Keeping the IM Column Store transactionally consistent. •  Rate of change, compression level, location of the changed rows, type of operations being performed.
  • 20. 20 Optimizer 1.  In 12c the optimizer is fully aware of the In- Memory Column Store. This means that the optimizer will cost the read from the In- memory Column Store. 2.  Using the same statistics and also new In- Memory statistics
  • 21. 21 Optimizer 10053 trace SELECT /* opt_trace_test */ sum(lo_revenue) FROM lineorder lo, customer c WHERE lo.lo_custkey=c.c_custkey AND c_region='AFRICA'; column sql_text format a30 select sql_id, child_number, sql_text from v$sql where sql_text like '%opt_trace_test%'; SQL_ID ------------- 5b8n5m6gtx71r
  • 22. 22 Optimizer 10053 trace (cont) alter session set max_dump_file_size = unlimited; execute DBMS_SQLDIAG.DUMP_TRACE(- p_sql_id='5b8n5m6gtx71r', - p_child_number=0, - p_component='Optimizer', - p_file_id='TRACE_10053'); How to Obtain Tracing of Optimizer Computations (EVENT 10053) (Doc ID 225598.1) col value format a90 SELECT value FROM v$diag_info WHERE name='Default Trace File'; VALUE --------------------------------------------------------------------------------------- /u01/app/oracle/diag/rdbms/db_inst2/DBNAME/trace/DB_INST2_ora_130114_TRACE_10053.trc
  • 23. 23 Optimizer 10053 trace (cont) *************************************** BASE STATISTICAL INFORMATION *********************** Table Stats:: Table: CUSTOMER Alias: C #Rows: 120000 SSZ: 0 LGR: 0 #Blks: 1882 AvgRowLen: 107.00 NEB: 0 ChainCnt: 0.00 SPC: 0 RFL: 0 RNF: 0 CBK: 0 CHR: 0 KQDFLG: 1 #IMCUs: 1 IMCRowCnt: 120000 IMCJournalRowCnt: 3000 #IMCBlocks: 0 IMCQuotient: 1.000000 Column (#1): C_CUSTKEY(NUMBER) AvgLen: 5 NDV: 120000 Nulls: 0 Density: 0.000008 Min: 1.000000 Max: 120000.000000 *********************** Table Stats:: Table: LINEORDER Alias: LO #Rows: 23996670 SSZ: 0 LGR: 0 #Blks: 335060 AvgRowLen: 96.00 NEB: 0 ChainCnt: 0.00 SPC: 0 RFL: 0 RNF: 0 CBK: 0 CHR: 0 KQDFLG: 1 #IMCUs: 23 IMCRowCnt: 23996670 IMCJournalRowCnt: 599917 #IMCBlocks: 0 IMCQuotient: 1.000000 Column (#3): LO_CUSTKEY(NUMBER) AvgLen: 5 NDV: 80504 Nulls: 0 Density: 0.000012 Min: 1.000000 Max: 119999.000000
  • 24. 24 Disabling and Enabling In-Memory To disable In-Memory scans set the parameter INMEMORY_QUERY = DISABLE Plans will get the cost based on disk statistics and scans will be from the IM Column Store. Use hint INMEMORY to force In-Memory Scan even if INMEMORY_QUERY is disabled. NO_INMEMORY disables In-Memory scan even if the table is in the In-Memory Column Store. SELECT /*+ INMEMORY */ sum(lo_revenue) FROM lineorder lo, customer c WHERE lo.lo_custkey=c.c_custkey AND c_region='AFRICA’; SELECT /*+ NO_INMEMORY */ sum(lo_revenue) FROM lineorder lo, customer c WHERE lo.lo_custkey=c.c_custkey AND c_region='AFRICA’;
  • 25. 25 Optimizer Summary •  In 12.1.0.2 the Optimizer is In-Memory aware. •  In-Memory statistics automatically generated at parse. •  Cost model adjusted for costing In-Memory Scans •  New INMEMORY and NO_INMEMORY hints
  • 27. 27 Queries •  We have chosen some of the queries that are candidates to benefit from Database In- Memory.
  • 28. 28 Function MAX(column) select max(lo_ordtotalprice) from lineorder; MAX(LO_ORDTOTALPRICE) --------------------- 55903140 Elapsed time: 0.004 select /*+ NO_INMEMORY */ max(lo_ordtotalprice) from lineorder; MAX(LO_ORDTOTALPRICE) --------------------- 55903140 Elapsed time: 4.014
  • 29. 29 Function MAX(column) B-tree index on lo_ordtotalprice create index ordtotalprice_ix on lineorder(lo_ordtotalprice); select /*+ NO_INMEMORY */ max(lo_ordtotalprice) from lineorder; MAX(LO_ORDTOTALPRICE) --------------------- 55903140 Elapsed time: 0.001
  • 30. 30 Function MAX(column) How about Result Cache? SQL show parameter result_cache_max_size big integer 22000K select /*+ RESULT_CACHE */ max(lo_ordtotalprice) from lineorder; MAX(LO_ORDTOTALPRICE) --------------------- 55903140 Elapsed time: 0.001
  • 31. 31 How do we know it used the In-Memory Column Store? select n.name, s.value from v$mystat s, v$statname n where s.statistic#=n.statistic# and n.name like 'IM scan CUs columns accessed'; ----------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ----------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 3 | 2224 (12)| 00:00:01 | | 1 | SORT AGGREGATE | | 1 | 3 | | | | 2 | TABLE ACCESS INMEMORY FULL| LINEORDER | 24M| 68M| 2224 (12)| 00:00:01 | ----------------------------------------------------------------------------------------- NAME VALUE ---------------------------------------------------------------- ---------- IM scan CUs columns accessed 45
  • 32. 32 One equality predicate SELECT lo_orderkey, lo_custkey, lo_revenue FROM lineorder WHERE lo_orderkey = 4000000; LO_ORDERKEY LO_CUSTKEY LO_REVENUE ----------- ----------- ----------- 4000000 51832 6983797 4000000 51832 917952 4000000 51832 2501733 4000000 51832 7895007 Elapsed time: 0.002 SELECT /*+ NO_INMEMORY */ lo_orderkey, lo_custkey, lo_revenue FROM lineorder WHERE lo_orderkey = 4000000; LO_ORDERKEY LO_CUSTKEY LO_REVENUE ----------- ----------- ----------- 4000000 51832 6983797 4000000 51832 917952 4000000 51832 2501733 4000000 51832 7895007 Elapsed time: 4.528 IM scan CUs columns accessed 3 IM scan segments minmax eligible 44 IM scan CUs pruned 43
  • 33. 33 One equality predicate B-tree index on lo_orderkey create index lo_orderkey_ix on lineorder (lo_orderkey); SELECT /*+ NO_INMEMORY */ lo_orderkey, lo_custkey, lo_revenue FROM lineorder WHERE lo_orderkey = 4000000; LO_ORDERKEY LO_CUSTKEY LO_REVENUE ----------- ----------- ----------- 4000000 51832 6983797 4000000 51832 917952 4000000 51832 2501733 4000000 51832 7895007 Elapsed time: 0.001
  • 34. 34 Three equality predicate SELECT lo_orderkey, lo_custkey, lo_revenue FROM lineorder WHERE lo_custkey = 13286 AND lo_shipmode = 'TRUCK’ AND lo_orderpriority = '3-MEDIUM’; LO_ORDERKEY LO_CUSTKEY LO_REVENUE ----------- ----------- ----------- 8268262 13286 6777268 8268262 13286 6207689 9048868 13286 6394887 17521920 13286 2905822 19397281 13286 3573400 Elapsed time: 0.002 SELECT /*+ NO_INMEMORY */ lo_orderkey, lo_custkey, lo_revenue FROM lineorder WHERE lo_custkey = 13286 AND lo_shipmode = 'TRUCK’ AND lo_orderpriority = '3-MEDIUM’; LO_ORDERKEY LO_CUSTKEY LO_REVENUE ----------- ----------- ----------- 8268262 13286 6777268 8268262 13286 6207689 9048868 13286 6394887 17521920 13286 2905822 19397281 13286 3573400 Elapsed time: 4.868 IM scan CUs columns accessed 3 IM scan segments minmax eligible 44 IM scan CUs pruned 43
  • 35. 35 How about composite index? create index cust_ship_pri_ix on lineorder (lo_custkey, lo_shipmode, lo_orderpriority); SELECT /*+ NO_INMEMORY */ lo_orderkey, lo_custkey, lo_revenue FROM lineorder WHERE lo_custkey = 13286 AND lo_shipmode = 'TRUCK’ AND lo_orderpriority = '3-MEDIUM’; Customer#000118324 JORDAN Customer#000119371 ETHIOPIA Customer#000119386 SAUDI ARABIA Customer#000118412 VIETNAMLO_ORDERKEY LO_CUSTKEY LO_REVENUE ----------- ----------- ----------- 8268262 13286 6777268 8268262 13286 6207689 9048868 13286 6394887 17521920 13286 2905822 19397281 13286 3573400 Elapsed time: 0.001
  • 36. 36 Greater Than () Instead of Equality (=) SELECT MAX(lo_ordtotalprice) FROM lineorder WHERE lo_quantity 74; Elapsed time: 0.002 SELECT MAX(lo_ordtotalprice) FROM lineorder WHERE lo_quantity 74; Elapsed time: 4.82 IM scan CUs columns accessed 3 IM scan segments minmax eligible 44 IM scan CUs pruned 43
  • 37. 37 How about an index? create index lo_quantity_ix on lineorder(lo_quantity); SELECT /*+ INDEX(a lo_quantity_ix) */ MAX(lo_ordtotalprice) FROM lineorder a WHERE lo_quantity 74; Elapsed time: 0.001
  • 38. 38 Bloom Filter Example SELECT c.c_name, c.c_nation FROM customer c, part p, lineorder lo WHERE lo.lo_custkey = c.c_custkey AND lo.lo_partkey = p.p_partkey AND p.p_name = 'white salmon'; C_NAME C_NATION ------------------------- --------------- Customer#000118324 JORDAN Customer#000119371 ETHIOPIA Customer#000119386 SAUDI ARABIA Customer#000118412 VIETNAM ... ...
  • 39. 39 Vector Group By Example SELECT /*+ VECTOR_TRANSFORM */ c.c_name, c.c_nation, sum(lo_ordtotalprice) FROM customer c, part p, lineorder lo WHERE lo.lo_custkey = c.c_custkey AND lo.lo_partkey = p.p_partkey AND p.p_name = 'white salmon' group by c.c_name, c.c_nation; ... ... C_NAME C_NATION SUM(LO_ORDTOTALPRICE) ------------------------- --------------- --------------------- Customer#000118540 ROMANIA 12634439 Customer#000119051 ARGENTINA 28032775 Customer#000118129 JAPAN 22258279 Customer#000118198 UNITED STATES 17849279
  • 40. Usage with Oracle Technologies
  • 41. 41 RAC Each node in a RAC environment has its own IM column store. Objects populated into memory will be distributed across all of the IM column stores in the cluster. ALTER TABLE lineorder INMEMORY DISTRIBUTE BY PARTITION; ALTER TABLE lineorder INMEMORY DISTRIBUTE AUTO DUPLICATE ALL;
  • 42. 42 M6-32 M6-32 SMP removes the overhead of distributing queries across a cluster and coordinating transactions. Algorithms NUMA optimized. Memory interconnect far faster than any network.
  • 43. 43 Exadata Exadata Complete fault-tolerant In-Memory solution. Exceed DRAM limits and transparently scale across Memory, Flash and Disk. Initial population of data into the In- Memory column store from storage is very fast. The In-Memory Aggregation optimization, can be offloaded to Exadata storage cells
  • 44. 44 Oracle Technologies •  Data Guard •  Golden Gate •  Oracle Multitenant •  Partitioning •  Parallelism •  Resource Manager •  RMAN •  ALTER TABLE EXCHANGE
  • 45. 45 Partition Exchange 1.  Create external table for flat files 2.  Use CTAS to create non part table and gather table stats 3.  Set INMEMORY attribute ON 4.  Populate non part table in column store 5.  Alter table table_name exchange partition part name with table non part table;
  • 47. 47 The benefits of IM Column Store Speed up Scans, Joins, Aggregates. Scan of large tables and using predicates like =, , , IN Querying a subset of columns in a table, for example, selecting 5 of 100 columns. Accelerating joins by converting predicates on small dimension tables into filters on a large fact table.
  • 48. 48 Do or Don’t? Business applications Ad-hoc analytic queries Data warehouse workloads
  • 49. 49 Do or Don’t? OLTP databases short transactions using index lookups
  • 50. 50 Do Queries that scan a large number of rows and apply filters that use operators such as the following: =, , , and IN. Queries that select a small number of columns from a table or materialized view with a large number of columns, such as a query that selects five columns from a table with 100 columns. Queries that join a small table to a large table. Queries that aggregate data.
  • 51. 51 Don’t Queries with complex predicates. Queries that select a large number of columns. Queries that return a large number of rows. Queries with multiple large table joins.
  • 52. 52 Don’t In-memory speeds up analytic data access, not: Network round trips, logon/logoff Parsing, PL/SQL, complex functions Data processing (as opposed to access) Complex joins or aggregations where not much data is filtered before processing Load and select once - Staging tables, ETL, temp tables
  • 53. Is it for me? Conclusion
  • 54. 54 KEEP CALM AND ASK ME Tú Pregúntame … Please visit my blog at: https://jorgebarbablog.wordpress.com Email: jorge.barba@accenture.com