Quantcast
Channel: Oracle Bloggers
Viewing all articles
Browse latest Browse all 19780

Exadata Smartscan For IAS

$
0
0

Hello,

A few weeks ago, when one of our customers run annual job batches on Exadata (db version 11.2),

they realized that IAS was dramatically slower  than CTAS  for  the same tables and app.

There was a really huge difference on duration between them,  whilst CTAS was taking 40 sec. IAS took 6 min!

Than I have checked the execution plans of those queries and saw that

CTAS was doing Smart Scan, it's wait event was "cell smart table scan" and  Cell Offload Effiency %91

but IAS was not doing !

(1)prtscr of CTAS

Here is the output of IAS execution  plan that shows the operation that resulted in the "cell multiblock physical read" wait event on the system.

(1)prtscr of IAS

Before 11gr2, full table scan access path read all the blocks of a table (or index fast full scan) under high water mark into the buffer cache  unless either "_serial_direct_read" hidden parameter is set to true or the table/index have default parallelism set.

In 11gR2, Oracle will automatically decides whether to use direct path reads bypassing buffer cache for serial full table scans.

When PARALLEL hint is used or Serial Direct Read is enabled, SMART SCAN is enabled for INSERT Dml !

Depending on the table segment size and the db_cache_size, Oracle Database Optimizer version 11g may decide to read blocks into buffer cache instead of offloading the data scanning process to the Storage Cells.

Solution;

Setting "_serial_direct_read" = "true" allows smart scan to be used while using INSERT from SELECT

alter session set "_serial_direct_read"=true;

INSERT INTO table SELECT /*+full(w)*/

By using this setting, Smart Scan worked and query result decreased from 6min to 48sec !!!

Or use APPEND hint

CTAS command always uses direct path but INSERT AS SELECT needs an APPEND hint to go direct,

so data bypasses buffer caches

INSERT /*+ APPEND */ INTO table SELECT /*+full(w)*/

and then;

I checked the parallel_degree_policy parameter, it is “manual”

Then I altered the table with parallel degree 8

execute immediate 'ALTER SESSION ENABLE PARALLEL DML';

INSERT/*+ append parallel */INTO tableSELECT /*+full(w)*/

and saw that Smart Scan worked and IAS duration dramatically decreased from 6min to 8 sec!!!

Related Note from Oracle Support:

Exadata Smartscan Is Not Being Used On Insert As Select [ID 1348116.1]






Viewing all articles
Browse latest Browse all 19780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>