Friday, February 26, 2010

Ozcor Install Remote Starter

Materialized Views refresh report metrics for OS from AWR

Anyone who has attended a course of sql or have read books or records connected with "variable binding" and know it is a concept closely linked to the performance of applications. Especially in OLTP systems is strongly recommended to use bind variables in statements to avoid hard parsing and so minimize the use of shared pool and get a better performance to skip the parsing stage in successive runs to the first execution of a sentence given.

The fact of "binder" although this circumscribed within good practice also has certain problems and you do not know what values \u200b\u200bwill be used to instantiate and bind variables is not clear for the optimizer to build plan. From 9i there is a mechanism called "bind peeking" that allows the optimizer know the values \u200b\u200bof the first instantiation and therefore put together a concrete plan. This new feature introduced new problems. The binding and histograms do not get quite right. Remember that the optimizer histograms and help you provide the data distribution.

As I said, the binder the optimizer does not know in advance that instantiate each variable value bind and therefore can not adapt the plan to the input values. If the data distribution is uniform this is not a problem, but what happens if the distribution is uneven?. What happens if the first instantiation is generated a plan to use full scan because the input value is low selectivity and then following instantiations of values \u200b\u200bhave high selectivity?. The latter usually require access to indices, but the plan was set with the first instantiation and therefore will use full scan when really should use index access, imagine how difficult it can be this. For example, one morning a programmer to run a query instance with a value or unusual edge to make a complex report that covers a high percentage of rows and cocked a plan with full access on a large table scan, then if the cursor remains in memory, the applications will use the same cursor for specific searches and will use the query plan generated by the odd (which used full scan), it sounds chaotic, no?. In 11g R1

added a new feature called "adaptive cursors" that solves the problem of 'bind peeking. " Here I show you some tests I did:

For the test I create a simple table with two columns X and Y. The column and has 3 possible values \u200b\u200b(A, B and C). Where A is very low selectivity, B and C is half selectivity has high selectivity.
2 PCTFREE 90;
Table created. Cree


table T with PCTFREE to 90% in order to generate many blocks with not many rows.

 rop @ DESA11G> insert into t 
2 select t_seq.nextval,
3 case when (rownum Between 1 and 4 million) then 'A'
4 when (rownum Between 4000001 and 5000000) then 'B'
5 when (rownum Between 5000001 and 5000010) then 'C'
6 end
7 from dual 8 connect by rownum


5000010 rows created.

rop @ DESA11G> select bytes, blocks from user_segments WHERE segment_name = 'T';


BYTES BLOCKS ---------- ---------- 82 944 679 477 248



I created a table that weighs more than 600Mb. An index
Now, I gather statelet


rop @ DESA11G> create index on t_idx t (y);

Index created.

rop @ DESA11G> begin
2 dbms_stats.gather_table_stats (ownname => user,
3 tabname => 'T',
4 method_opt => 'for all indexed columns',
5 cascade => true) end
6 ;
7 /

PL / SQL procedure successfully completed.

rop @ DESA11G> select and count (1)

2 from t 3 group by y;

AND COUNT (1)
- ----------
A B 1000000 4000000

C 10


In the last query is the distribution of the column and table T.

I will run a query and I will instantiate the bind variable: v with the value 'A' to arm a plan that uses full_scan:


rop @ DESA11G> variable v char (1);
@ rop DESA11G> exec: v: = 'A';

PL / SQL procedure successfully completed.

rop @ DESA11G> set @ Car train on
rop DESA11G> select avg (x) from t where and =: v;

AVG (X) ----------

21640320.5


Plan -----------------------------------------------
Execution
----------- Plan hash value: 1842905362

---------------------------------------------------------------------------


2 - filter ("Y" =: V)



Statistics --------------------------------
-------------------------- 329 recursive calls 0 db block gets
Consistent
gets physical reads 0 redo


size 243 bytes Sent via SQL * Net to client 233 bytes
Received via SQL * Net from client 2 SQL * Net
roundtrips to / from client
7 sorts (memory)
0 sorts (disk) 1 rows processed



The plan effectively used full_scan. Note the large number of physical reads.

us consult the V $ SQL:


rop @ DESA11G> select sql_id, child_number, is_bind_sensitive, is_bind_aware
2 from v $ sql WHERE
3 sql_text = 'select avg (x) from t where and =: v';
SQL_ID
IS_BIND_SENSITIVE CHILD_NUMBER IS_BIND_AWARE
------------- -------------------- ------------ - --------------
d9p5ax32fmqdn 0 YN


As shown in 11g adding new columns to the view v $ sql for the bind variables. Instances and
 
: = 'C', which has very high selectivity:


rop @ DESA11G> exec: v: = 'C';

PL / SQL procedure successfully completed.

rop@DESA11G> set autotr on
rop@DESA11G> select avg(x) from t where y = :v;

AVG(X)
----------
24640325.5


Plan de Ejecución
---------------------------------------------------------- Plan hash value: 1842905362
---------------------------------------------------------------------------

233 Bytes Received via SQL * Net from client 2 SQL * Net
roundtrips to / from client
0 sorts (memory) 0 sorts (disk) 1 rows processed

Used
full scan to return only 10 values, we observe physical readings again.

I will refer back to the v $ sql: rop @ DESA11G> select sql_id, child_number, is_bind_sensitive, is_bind_aware
2 from v $ sql WHERE
3 sql_text = 'select avg (x) from t where and =: v ';
SQL_ID
CHILD_NUMBER IS_BIND_SENSITIVE IS_BIND_AWARE
------------- ------------ --------------- ----- ---------------
d9p5ax32fmqdn 0 YN


Follow as before.
Vuelvo repeat the previous query:


Rop DESA11G @> select avg (x) by t where y =: v;

AVG (X) ----------

24640325.5


Implementation Plan
---------------------------------------------- ------------
Plan hash value: 1842905362

------------------------------
--------------------------------------------- 1 4 physical reads 0 redo size


Sent 243 bytes via SQL * Net to client 233
Bytes Received via SQL * Net from client 2 SQL * Net
roundtrips to / from client
0 sorts (memory)
0 sorts (disk) 1 rows processed

 
The plan continues to set full access scan, but now look at physical readings. Were only 4!.


rop @ DESA11G> set off
Car train rop @ DESA11G> select sql_id, child_number, is_bind_sensitive, is_bind_aware
2 from v $ sql WHERE
3 sql_text = 'select avg (x) from t where and =: v';
SQL_ID
CHILD_NUMBER IS_BIND_SENSITIVE
IS_BIND_AWARE ------------- ------------ -------------------- --- ------------
d9p5ax32fmqdn 0 1 YY YN
d9p5ax32fmqdn


The query now shows another sqlid who is the son of the original with is_bind_aware column "Y". The latest plan showed full scan but does not match the few physical reads and logical, because the method I used to get the plan (dbms_xplan.diplay not have the option to indicate the child) does not show the plan but only 1 child plan parent (child = 0). Then I will show a trace 10046 actually used access index (also can be done with dbms_xplan.display_cursor indicating the child), which closes with the small number of readings needed. Consulting

new view of "adaptive cursors" is seen as Oracle keeps track of the executions and automatically adapts to the abrupt changes of selectivity to instantiate the variables:


rop @ DESA11G> select child_number,
2 bind_set_hash_value,
3 Peeke,
4 Executions,
5 rows_processed, buffer_gets
6, 7 cpu_time

from v $ sql_cs_statistics 8 9 WHERE
sql_id = 'd9p5ax32fmqdn';
CHILD_NUMBER
BIND_SET_HASH_VALUE P Executions ROWS_PROCESSED BUFFER_GETS CPU_TIME
------- ----- ------------------- - ---------- -------------- ----------- ----------
1 2477564004 Y 1 21 4 0
0 816821622 Y 1 4000001 82086 0


rop@DESA11G> ed
Escrito file afiedt.buf

1 select * from v$sql_cs_histogram
2 where sql_id ='d9p5ax32fmqdn'
3* order by child_number,bucket_id
rop@DESA11G> /
000000044B9DC7B8 3303659956 d9p5ax32fmqdn 0 0 1
000000044B9DC7B8 3303659956 d9p5ax32fmqdn
000000044B9DC7B8 0 1 0 0 2 1 3303659956 d9p5ax32fmqdn 000000044B9DC7B8
3303659956 d9p5ax32fmqdn
000000044B9DC7B8 1 0 3 1 1 0 3303659956 d9p5ax32fmqdn
000000044B9DC7B8 3303659956 d9p5ax32fmqdn

1 2 0 6 rows selected.

 Recording and measuring activity was detected quickly internally that the plan was inadequate and was changed. 

below shows the result of the event trace with 10046:

The principal or parent cursor:


************************* ************************************************** *****
  
SQL ID: d9p5ax32fmqdn
Plan Hash: 1842905362
select avg(x)
from
t where y = :v


call count cpu elapsed disk query current rows <= 5000010;
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 3 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 6 12.58 11.26 246075 246111 0 3
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 12 12.58 11.26 246075 246111 0 3

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 82

Rows Row Source Operation
 -------  --------------------------------------------------- 
1 SORT AGGREGATE (cr=82037 pr=82025 pw=0 time=0 us)
4000000 TABLE ACCESS FULL T (cr=82037 pr=82025 pw=0 time=19822 us cost=22641 size=28010066 card=4001438)


Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 6
0.00 0.00 direct path read 1956 0.23 1.58 SQL * Net message
from client 6 0.00 0.04
****************************** **************************************************


The cursor Child 1:


*************************************** *****************************************

SQL ID: 804rjbx6snjv4
Plan Hash: 3178687684
select avg(x)
from
t where y = :v

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
 Fetch        2      0.00       0.00          0          4          0           1 
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 0.00 0.00 0 4 0 1

Misses in library cache during parse: 1
Misses in library cache during execute: 1
Optimizer mode: ALL_ROWS
Parsing user id: 82

Rows Row Source Operation
------- ---------------------------------------------------
1 SORT AGGREGATE (cr=4 pr=0 pw=0 time=0 us)
10 TABLE ACCESS BY INDEX ROWID T (cr=4 pr=0 pw=0 time=0 us cost=4 size=7 card=1)
10 INDEX RANGE SCAN T_IDX (cr=3 pr=0 pw=0 time=0 us cost=3 size=0 card=1)(object id 83154)


Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 2 0.00 0.00 SQL * Net message
from client 2 0.00 0.01
********************************* ***********************************************


Once again we see that version after version will add "corrections" to the optimizer for costs to reduce the margin of error and stabilize the systems.


Wednesday, February 24, 2010

Under Sink Dishwasher

Second Meeting of 2010

On Saturday March 6 at the Board of Cooperation, San Martín 1371, at 10:30 am Assembly will make the second year of Open Letter.
This new assembly will be attended by Secretary General deAMSAFE, Sonia Alesso to discuss the conflict teachers who comenzóesta week with three days of strikes. This first visit is part of the items proposed to convene different stakeholders of the area of \u200b\u200bthe province and the nation on issues that deserve and need to be debated.
We hope that the invitation is wide and numerous.
We summoned, we hope

Press and Communication Commission
Santa Fe Open Letter

Friday, February 19, 2010

Is It Ok To Use Epsom Salt On A Sprained Wrist

binding Improving performance with the new cursor adapter (Adaptive Cursors)

this note, the idea is to show some of the first tests I made on table compression. One of the features most strongly presented by Oracle in its latest version (11g) is just the advanced compression. From 9i tables can be compressed but with certain restrictions. In 9i and 10g compression might call the basic tables as it has several limitations and compression only applies to a restricted set of operations (eg for direct insert) which makes it quite useful for DW systems but not for OLTP databases. Oracle 11g introduced

advanced compression to reduce resource use and handling of large volumes of data. Allows a significant reduction in required storage for relational or structured data (tables), unstructured data (files) or data backup (backups).

The new OLTP Table Compression feature uses an algorithm designed to work with OLTP applications. This algorithm works by eliminating duplicate values \u200b\u200bat the block level. The expected compression ratio is 2 to 3 using OLTP Compression. The most novel feature is that this information can be read without having to decompress compressed so there is no performance degradation and may even improve the performance due to a reduction of I / O as they need to access fewer blocks to obtain they joined ranks with the consequent reduction in required buffer cache. Anyway I like to see to believe and therefore I will show my evidence to you guys are to draw their own conclusions, as well as encourage them to take practice test ever before deploying.

I have no hand in this moment the 11g R2 database so my tests will be based on R1. R2 change in the syntax but the semantics of operations is the same as in R1. In case anyone wanted to try my test in R2, and is too lazy to consult the SQL Reference manual, I pass the differences:


COMPRESS FOR ALL OPERATIONS (11gR1) = COMPRESS FOR OLTP (11gR2) DIRECT_LOAD COMPRESS FOR OPERATIONS (11gR1) COMPRESS = BASIC (11gR2) (*) default
For the test I will create 3 tables:

T: No Compression
T_C_DSS: basic compression or compression DSS (the same type of compression
earlier)
T_C_OLTP: Advanced Compression (11g +)



Connected to: Oracle Database 11g
Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 rop @ ROP11G> create table t (x int, char (30), z date); 

Table created.

rop @ ROP11G> create table t_c_dss (x int, char (30), z date) compress;

Table created.

rop @ ROP11G> create table t_c_oltp (x int, char (30), z date) compress for all Operations;

Table created.

rop @ ROP11G> select table_name, pct_free, compression, compress_for from user_t
2 WHERE table_name in ('T', 'T_C_DSS', 'T_C_OLTP');
 PCT_FREE 
TABLE_NAME COMPRESS COMPRESS_FOR
-------- ---------------------- ---------- -------- ----------
-------- T 10
T_C_DSS 0 ENABLED DISABLED DIRECT LOAD ONLY
T_C_OLTP 10 ENABLED FOR ALL OPERATIONS


Consulting in the catalog you can see the partition type. Note that the PCTFREE in dss is 0 since no changes are expected.
Now I will insert 5M rows at random but looking for a way to be repeated many times in the columns values \u200b\u200bto take advantage
compression column x inserted unique values, the column and insert letters A and B and the column z dates inserted up to 10 days after the test.


rop @ ROP11G> set timing on
rop @ ROP11G> set @ Car train on
rop ROP11G> insert into t select rownum
2, 3
chr (64 + trunc (dbms_random.value (1.3)))
4 trunc (sysdate) + trunc (dbms_random.value (1.10))
5 from dual 6 connect by rownum


5000000 rows created. After

: 00:02:57.65

Plan de Ejecución
----------------------------------------------------------
Plan hash value: 1350848739

-------------------------------------------------------------------------------
BY WITHOUT FILTERING 690 bytes received via SQL*Net from client
6 SQL*Net roundtrips to/from client
4 sorts (memory)
0 sorts (disk)
5000000 rows processed rop@ROP11G> commit;
Confirmación terminada.
Transcurrido: 00:00:00.06
rop@ROP11G> insert into t_c_dss
2 select rownum ,
3 chr(64+trunc(dbms_random.value(1,3))),
4 trunc(sysdate)+trunc(dbms_random.value(1,10))
5 from dual
6 connect by rownum
5000000 filas creadas.

Transcurrido: 00:02:48.43

Plan de Ejecución
 ----------------------------------------------------------  
Plan hash value: 1350848739

----------------------------------------------------------------------------------

client 3 sorts (memory)
0 sorts (disk) 5000000 rows processed

rop @ ROP11G> commit;
Confirmation
completed.
 Elapsed: 00:00:00.04 

rop @ ROP11G> insert into t_c_oltp
2 select rownum,
3 chr (64 + trunc (dbms_random.value (1.3))),
4 trunc (sysdate) + trunc (dbms_random.value (1.10))

5 from dual 6 connect by rownum

5000000 rows created.

Elapsed: 00:08:58.00 Execution Plan


-----------------------------------
----------------------- Plan hash value: 1350848739

-----------------------------------------------------------------------------------
3 sorts (memory)
0 sorts (disk) 5000000 rows processed



conventional insertion times for each table were:



T = 2m 57s 2m 48s
T_C_DSS
T_C_OLTP = 8m 54s

The insertion time of the OLTP table was 3 times greater than the DSS table and the common table, but more striking is the amount of redo used:

Redo Insert T = 292595868 ~ 279Mb
= Redo Insert in T_C_DSS = 290874948 ~ 277Mb
= Redo Insert in T_C_OLTP = 945961224 ~ = 902Mb



is also noted that the amount of redo is more than 3 times.
I searched metalink and the note "COMPRESS FOR ALL OPERATIONS
Generates lot of redo [ID 829068.1]
states that consumption is expected rather more redo dml operations on a table with advanced compression (CA).
 
Anyway, it takes more but lets see if and how much compressed:


rop @ ROP11G> select segment_name, blocks, round (bytes/1024/1024, 2) 2 Mb from user_segments
WHERE segment_name in ('T' 'T_C_DSS', 'T_C_OLTP');
segment_name
MB
BLOCKS ------------------------------ ----- ----- ---------- T 35456 277

T_C_OLTP
T_C_DSS 31744 248 11 264 88


 The compression on the table T_C_OLTP was significant compared with the other two tables. Also note that the ratio of 3 is still maintained as the OLTP table allocates 3 times less space than tables compressed and uncompressed dss similar space that went wild. It seems that sacrificing more consumption and more time redo the insert was processing the results, no?. 

The next test will analyze the direct inserts. Remember that this type of insert is used to bulk load, especially in systems Datawarehouse (ETL). I will test
inserting 1M rows:


rop @ ROP11G> insert / * + APPEND * / into t select rownum
2, 3
chr (64 + trunc (dbms_random.value (1.3))), trunc
4 (sysdate) + trunc (dbms_random.value (1.10))

5 from dual 6 connect by rownum

1000000 rows created.

Elapsed: 00:00:29.37

1 insert / * + APPEND * / into t_c_dss
2 select rownum,
3 chr (64 + trunc (dbms_random.value (1.3))),
4 trunc (sysdate ) + trunc (dbms_random.value (1.10))

5 from dual 6 connect by rownum
* rop @ ROP11G> /

1000000 rows created.

Elapsed: 00:00:32.01
rop @ ROP11G> commit;
Confirmation
completed.

Elapsed: 00:00:00.07
rop @ ROP11G> ed
Written afiedt.buf file
1 insert / * + APPEND * / into t_c_oltp
2 select rownum,
3 chr (64 + trunc (dbms_random.value ( 1.3))),
4 trunc (sysdate) + trunc (dbms_random.value (1.10)) from dual

5 6 * connect by rownum
rop @ ROP11G> /
 
1000000 rows created.

Elapsed: 00:00:30.01
rop @ ROP11G> commit;
Confirmation
completed.

Elapsed: 00:00:00.01


With direct insert times were similar:



T_C_DSS T = 29s = 32s = 30s

T_C_OLTP

and space crazy:


rop @ ROP11G> Written
ed afiedt.buf

1 file select segment_name, blocks, round (bytes/1024/1024, 2) Mb from user_segments
2 * WHERE segment_name in ('T', 'T_C_DSS', 'T_C_OLTP') @ rop
ROP11G> /

segment_name MB
BLOCKS ------------------------------ ---------- -

--------- T 48768 381
T_C_DSS 33792 264 13312 104

T_C_OLTP

From the above results we see that the increased direct insert crazy space of each segment as follows:
 
segment_name ---------- Deltha in
Mb

-------------------- ------- T 104 (381-277)
T_C_DSS 16 (264-248)
T_C_OLTP 16 (104 - 88)



From these results it follows that the basic and advanced compression worked well for direct insert, both only had to allocate an additional 16MB to accommodate new rows 1M. However the table if compression had to allocate an extra 25%.

Another point that interests me is the update's test and see how the behavior of this type of operation in each case. To test this I will change the column at 50000 rows.


rop @ DESA11G> update t set and = 'C' where y = 'B' and rownum

50000 rows updated.

Elapsed: 00:00:01.96 Execution Plan


-----------------------------------
----------------------- Plan hash value: 3603919313

------------------- --------------------------------------------------
-------

Note
-----
- dynamic sampling used for this statement


Estadísticas
----------------------------------------------------------
258 recursive calls
1667 db block gets
1436 consistent gets
1028 physical reads 574 bytes received via SQL*Net from client
6 SQL*Net roundtrips to/from client
7 sorts (memory)
0 sorts (disk)
50000 rows processed

rop@DESA11G> commit;
 Confirmación terminada. 

rop@DESA11G> ed
Written fillet afiedt.buf

t_c_dss September 1 * update y = 'C' where y = 'B' and rownum
Rop DESA11G @> /
 
50000 rows updated.

Elapsed: 00:00:01.84 Execution Plan

----------------------------------- -----------------------
Plan hash value: 2179303604
 
------------------- -------------------------------------------------- ----------


257 recursive calls
51518 db block gets
827 consistent gets
890 physical reads
15677976 redo size
867 bytes sent via SQL*Net to client
580 bytes received via SQL*Net from client
6 SQL*Net roundtrips to/from client
7 sorts (memory)
0 sorts (disk)
50000 rows processed

rop@DESA11G> commit;

Confirmación terminada.

Transcurrido: 00:00:00.01
rop@DESA11G> ed
Escrito file afiedt.buf

1* update t_c_oltp set y='C' where y = 'B' and rownum
rop@DESA11G> /

50000 rows updated.

Elapsed: 00:01:09.89 Execution Plan
 
----------------------------------- -----------------------
Plan hash value: 2618608701

------------------- -------------------------------------------------- -----------

1567 physical reads 40901448 redo size 868 bytes
Sent via SQL * Net to client 581
Bytes Received via SQL * Net from client 6 SQL * Net <= 5000000;
roundtrips to / from client
7 sorts (memory)
0 sorts (disk)
50000 rows processed

rop @ DESA11G> commit;
Confirmation
completed.

Elapsed: 00:00:00.01


update times of the column and in each case were:


Db block gets Redo Time ------ ---- ------
-------

T 1s 1s T_C_DSS 7Mb
1667 51518
15Mb T_C_OLTP 1m 9s 39Mb

<=5000000)

6153098 times the OLTP table for mass update are much higher compared to the times of the same operation on other tables. I tried to try to make the same update but with 1M rows and tables, but ty for dss times were less than 2 minutes to the case of OLTP table and did not end after 2 hours I had to kill the session. I tried 3 times on different days and in the three cases I had to stay the execution.

In the last test I'll see how they behave the selectmen's. For details go to activate the 10046 trace. The sentence I built runs along the table:


rop @ DESA11G> ALTER SESSION SET EVENTS '10046 trace name context forever, level 8 ';

Session altered.

Elapsed: 00:00:00.07
rop @ DESA11G> ed
Written afiedt.buf

1 file select z, count (*), max (z) t

2 from 3 * group by z @ DESA11G
rop > / Z

COUNT (*) MAX (Z)

--------- ---------- --------- 18-FEB-10 666 293 18
-FEB-10 17-FEB-10 665 982 17-FEB-10
20-FEB-10 667 869 20-FEB-10
16-FEB-10 666 656 16-FEB-10
23-FEB-10 665 526 23-FEB -10
19-FEB-10 666 827 19-FEB-10 <= 5000000;
22-FEB-10 665 960 22-FEB-10
21-FEB-10 666 494 21-FEB-10
24-FEB-10 668 393 24-FEB-10

9 rows selected.

Elapsed: 00:00:09.89
Rop DESA11G @> ed
Written fillet afiedt.buf

*************************** ************************************************** ***

select z, count (*), Max (z) t

the group by z
call count cpu elapsed
disk query current rows ------- ------
- ------ ---------- ---------- ---------- ---------- ---- ------
Parser 1 0.02 0.01 2 2 0 0 1 0.00
Run 0.00 0 0 0 0
Fetch 2 10.33 9.55 41379 42190 0 9
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 10.35 9.57 41381 42192 0 9 <=5000000)

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 82

Rows Row Source Operation
------- ---------------------------------------------------
9 HASH GROUP BY (cr=42190 pr=41379 pw=0 time=0 us cost=11949 size=44228052 card=4914228)
6000000 TABLE ACCESS FULL T (cr=42190 pr=41379 pw=0 time=29090 us cost=11414 size=44228052 card=4914228)


Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 2 0.00 0.00
SQL*Net message to client 2 0.00 0.00
reliable message 1 0.00 0.00
enq: KO - fast object checkpoint 1 0.00 0.00
direct path read 334 0.00 0.02
SQL*Net message from client 2 0.02 0.02
********************************************************************************


select z,count(*),max(z)
from t_c_dss
group by z

call count cpu elapsed disk query current rows <= 5000000;
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.01 0.01 2 2 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 10.71 10.02 33071 33680 0 9
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 10.72 10.04 33073 33682 0 9

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 82

Rows Row Source Operation
------- ---------------------------------------------------
9 HASH GROUP BY (cr=33680 pr=33071 pw=0 time=0 us cost=9723 size=46852029 card=5205781)
6000000 TABLE ACCESS FULL T_C_DSS (cr=33680 pr=33071 pw=0 time=0 us cost=9155 size=46852029 card=5205781)


Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 2 0.00 0.00
reliable message 1 0.00 0.00
enq: KO - fast object checkpoint 1 0.00 0.00 <=5000000)
direct path read 270 0.01 0.02
SQL*Net message from client 2 0.02 0.02
********************************************************************************

select z,count(*),max(z)
from t_c_oltp
group by z

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.01 0.00 2 2 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 9.82 9.42 12852 13635 0 9
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 9.83 9.42 12854 13637 0 9
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 82
  
Rows Row Source Operation ------- ---------------------------------------------------
9 HASH GROUP BY (cr=13635 pr=12852 pw=0 time=0 us cost=4271 size=50894532 card=5654948)
6000000 TABLE ACCESS FULL T_C_OLTP (cr=13635 pr=12852 pw=0 time=0 us cost=3651 size=50894532 card=5654948)

Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
   SQL*Net message to client                       2        0.00          0.00 
reliable message 1 0.00 0.00 enq: KO - fast object checkpoint 1 0.00 0.00
direct path read 110 0.00 0.00
SQL*Net message from client 2 0.02 0.02

times to resolve the consultation were:

T = 9.57s = 10.04s
T_C_DSS T_C_OLTP = 9.42s

 The OLTP select on the table was thrown the least time, showing that there was no overhead on the issue of compression. 

overall conclusion is that bulk of time and redo consumption on the OLTP table are important and need to be taken into account. Also consider that this mechanism, as is its name infers, is designed for OLTP databases where there is common massive change, although it is not that unusual in certain cases, as many hybrid bases behave as OLTP (eg during the day) and at night are used as DSS with significant batch processing, which usually brings massive changes in data.

The official paper:

"Advanced Compression with Oracle 11g R2" says
specific scripts are not compressed in each operation and the compression of the entire block is performed in a batch when a threshold is reached in the block. Surely that is why in my test times were excessive and that many rows to insert or modify the threshold was reached in several blocks firing live compression and adding processing time to the sentence.
I always like to thoroughly test each new feature to see if I can recommend to my clients because not everything that glitters is gold and sometimes there are restrictions that make it inapplicable in certain businesses. We also have to consider the economic issue, advanced compression, unlike basic compression is enabled for use with the Enterprise Edition license, you pay as a separate optional and therefore is a factor no less deserving is analyzed before to implement this new feature.