22
Exadata Smart Scan Exadata Smart Scan What is so smart about it? Uwe Hesse Senior Principal Instructor Oracle Certified Master http://uhesse.com Copyright © 2012, Oracle and/or its affiliates. All rights reserved.

Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Embed Size (px)

Citation preview

Page 1: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Smart Scan Exadata Smart Scan

What is so smart about it?

Uwe Hesse

Senior Principal Instructor

Oracle Certified MasterOracle Certified Master

http://uhesse.com

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

Page 2: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Quarter Rack – Hardware Viewpoint

Full

Rack

Half

Rack

Quarter

Rack

Multiple

Racks

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 2

RackRackRack

Page 3: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

X2-2 Database Servers (Sun Fire X4170 M2)

• 2 Six-Core Intel® Xeon® X5675 Processors

• Up to 144 GB DRAM (16 x 8GB)

• Dual-port 10GbE PCIe card• Dual-port 10GbE PCIe card

• Dual-port InfiniBand QDR (40 Gb/s) HCA

• 4 x 2.5” 300GB Disk Drives

• Disk Controller HBA with 512 MB BBWC• Disk Controller HBA with 512 MB BBWC

• Redundant Power Supplies, Fans

• ILOM

Installed Software:

• Oracle Database 11.2• Oracle Database 11.2

• Oracle Linux or Solaris

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 3

Page 4: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Storage Server Hardware (Sun Fire X4270 M2)

• 2 Six-Core Intel® Xeon® L5640 Processors

• 24 GB DRAM (6 x 4GB)

• 12 x 3.5” Disk Drives (600GB SAS or 2TB SAS)• 12 x 3.5” Disk Drives (600GB SAS or 2TB SAS)

• 4 x 96GB Flash PCIe Cards

• Dual-port InfiniBand QDR (40Gb/s) HCA

• Disk Controller SAS2 HBA with 512MB BBWC

• Redundant Power Supplies, Fans• Redundant Power Supplies, Fans

• ILOM

Installed Software:

• Oracle Exadata Storage Server Software

• Oracle Linux

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 4

• Oracle Linux

Page 5: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

InfiniBand Network

• Unified InfiniBand Network• Storage Network

• RAC Interconnect• RAC Interconnect

• High Performance, Low Latency Network• High Performance, Low Latency Network• 40 Gb/s bandwidth

• Zero-copy Zero-loss Datagram Protocol (ZDP RDSv3)

• SAN-like Efficiency (Zero copy, buffer reservation)• SAN-like Efficiency (Zero copy, buffer reservation)

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 5

Page 6: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Quarter Rack – Database Viewpoint

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 6

Page 7: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Database Viewpoint is unchanged

•Competitor: “Exadata is still Oracle!”

•Right – that is actually a good thing because:•Right – that is actually a good thing because:

•No change is needed for the Database Design

•No change is needed for the Application Code

•Migration to Exadata is relatively easy therefore•Migration to Exadata is relatively easy therefore

•DBA knowledge remains valid

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 7

Page 8: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata in the Marketplace

Rapid adoption in all geographies and industries

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 8

Page 9: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Classic Database I/O and SQL Processing Model

SELECT customer_id

FROM orders

WHERE order_amount>20000;

Rows returned1 6

WHERE order_amount>20000;

Extents identified SQL processing:

2 MB returned2 5

I/O issued I/O executed:

10 GB returned3 4

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 9

Page 10: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Smart Scan Idea

• “The fastest way of doing something is not to do it”

• Do not deliver the whole Data Volume up to the DB Layer!• Do not deliver the whole Data Volume up to the DB Layer!

• Instead, filter resp. project already on the Storage Layer!

• We want DB Intelligence built into the Storage Layer ...• We want DB Intelligence built into the Storage Layer ...

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 10

Page 11: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Remove the Storage Network Bottleneck

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 11

Page 12: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Smart Scan Model

SELECT customer_id

FROM orders

WHERE order_amount>20000;

Rows returned1 6

WHERE order_amount>20000;

iDB command

constructed

and sent to Exadata cells

Consolidated result

set built from all

Exadata cells

2 5

and sent to Exadata cells Exadata cells

SQL processing

in Exadata cells2 MB returned

to server3 4

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 12

Page 13: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Smart Scan

• Predicate filtering:

– Only the requested rows are returned to the database server – Only the requested rows are returned to the database server

rather than all the rows in a table.

• Column filtering:

– Only the requested columns are returned to the database

server rather than all the columns in a table.

– For example:

SQL> SELECT col1,col2 FROM t WHERE condition;

http://uhesse.com/2011/01/19/exadata-part-i-smart-scan/

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 13

Page 14: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Smart Scan Prerequisites

• Smart Scan is only possible for Full Table Scans or Full

Index Scans.Index Scans.

• Smart Scan can only be used for Direct-Path Reads:

• Direct-path reads are automatically used for parallel queries.

• Direct-path reads may also be used for serial queries.

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 14

Page 15: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Smart Scan

• Join processing:

– Star join processing is performed within Exadata Storage – Star join processing is performed within Exadata Storage

Server

• Scans on TDE encrypted data

• Scans on HCC compressed data

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 15

Page 16: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Hybrid Columnar Compression:

OverviewOverview

Warehouse Compression Archival CompressionWarehouse Compression

• 10x average storage savings

Archival Compression

• 15x average storage savings

Optimized for Speed Optimized for Space

• 10x average storage savings

• 10x scan I/O reduction

• Optimized for query performance

• 15x average storage savings

– Up to 50x on some data

• Greater access overhead

• For cold or historical data

Reduced Warehouse Size

• For cold or historical data

Reclaim Disks

Better Performance

Can mix compression types by partition for

Keep Data Online

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 16

Can mix compression types by partition for

Information Life Cycle Management

Page 17: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Hybrid Columnar Compression

Data OrganizationData Organization

Compression Unit

Block HeaderCU Header

C1

Block Header

C2

C3C4

Block Header

C5

Block Header

C8C7

• A compression unit is a logical structure spanning multiple

C2C3

C4

C5 C6

• A compression unit is a logical structure spanning multiple

database blocks.

• Each row is self-contained within a compression unit.

• Data is organized by column during data load.• Data is organized by column during data load.

• Each column is compressed separately.

• Smart Scan is supported.

http://uhesse.com/2011/01/21/exadata-part-iii-compression/

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 17

http://uhesse.com/2011/01/21/exadata-part-iii-compression/

Page 18: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Exadata Storage Index Idea

•“The fastest way of doing something is not to do it”

•Even faster than offload scanning to the Storage

Layer:Layer:

•Exclude areas from scanning when we know

the requested Data can‘t be there

http://uhesse.com/2011/01/20/exadata-part-ii-storage-index/

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 18

Page 19: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Storage Index with Partitions: Example

ORDER# ORDER_DATE(Partition Key)

SHIP_DATE ITEM(Partition Key)

1 2007 2007

2 2008 2008

• Queries on SHIP_DATE do not benefit from ORDER_DATE

3 2009 2009

• Queries on SHIP_DATE do not benefit from ORDER_DATE

partitioning:

– However, SHIP_DATE is highly correlated with ORDER_DATE.

• Storage index enhances performance for queries on • Storage index enhances performance for queries on SHIP_DATE:

– Takes advantage of the ordering created by partitioning

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 19

Page 20: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Smart Scan related Statistics & Wait-Events

Important Statistics:

cell physical IO interconnect bytescell physical IO interconnect bytes

cell physical IO interconnect bytes returned by smart scan

cell physical IO bytes saved by storage index

Important Wait-Events:

cell smart table scan

cell smart index scancell smart index scan

cell single block physical read

cell multiblock physical read

http://uhesse.com/2011/07/06/important-statistics-wait-events-on-exadata/

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 20

Page 21: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

Benefits Multiply

Less with Exadata Multiple terabytes of user Even less withLess with Exadata

Hybrid Column

Compression

Multiple terabytes of user

data normally require

multiple terabytes of I/O.

Even less with

partition pruning

Results in

Storage index skips Smart Scan filters the

Results in

real-time on

Database

MachineStorage index skips

worthless I/O.

Smart Scan filters the

remaining Candidate

Data and reduces the

Data Volume sent to

the Database Layer.

Machine

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 21

the Database Layer.

Page 22: Exadata Smart Scan What is so smart about it? · PDF fileExadata Storage Server Hardware (Sun Fire X4270 M2) •2 Six-Core Intel® Xeon® L5640 Processors •24 GB DRAM (6 x 4GB) •12

The smartest thing about Smart Scan

If you ask me:If you ask me:

Smartest thing is that it works transparently together

with the same Oracle Database Code

as used on Non-Exadata platformsas used on Non-Exadata platforms

Transparently except that it is 10 times faster

„Exadata is still Oracle!“ Love it :-)

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.4 - 22