Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Prev Previous commit
Merge remote-tracking branch 'upstream/develop' into feature/table_ac…
…cess_iprovements

# Conflicts:
#	tests/lib/mystats/mystats_pkg.sql
  • Loading branch information
jgebal committed Jul 28, 2017
commit a8d4ac74bb84e3e956788d3fdd140b4b0fe9e12e
34 changes: 17 additions & 17 deletions tests/lib/mystats/mystats_pkg.sql
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ create or replace package mystats_pkg authid current_user as
||
|| Optional statistics types are selected during calls to the MS_START procedure
|| and are all included by default:
||
||
|| 1. Statistics (V$SESSTAT)
|| 2. Latches (V$LATCH)
|| 3. Time Model (V$SESS_TIME_MODEL)
Expand Down Expand Up @@ -271,7 +271,7 @@ create or replace package body mystats_pkg as
, value
from v$sess_time_model
where sid = sys_context('userenv','sid')
and :g_include_time_model = 'Y']'
and :g_include_time_model = 'Y']'
using g_include_statistics, g_include_latches, g_include_time_model, g_include_time_model;
fetch rc_stat bulk collect into aa_stats;
close rc_stat;
Expand All @@ -297,11 +297,10 @@ create or replace package body mystats_pkg as
v_type st_stattype; --<-- statistic type
v_value st_statvalue; --<-- snapshot value for a statistic

/*
|| Downside of using associative arrays is that we have to sort
|| the output. So here's a couple of types and a variable to enable us
|| to do that...
*/
-- Downside of using associative arrays is that we have to sort
-- the output. So here's a couple of types and a variable to enable us
-- to do that...
-- -------------------------------------------------------------------
type aat_mystats_output is table of st_output
index by st_statname;
type aat_mystats_sorted is table of aat_mystats_output
Expand Down Expand Up @@ -384,14 +383,13 @@ create or replace package body mystats_pkg as
-- -----------------------------------------------
v_value := ga_mystats(c_run2)(v_name).value - ga_mystats(c_run1)(v_name).value;

/*
|| If it's greater than the threshold or a statistic we are interested in,
|| then output it. The downside of using purely associative arrays is that
|| we don't have any easy way of sorting. So we have to do it ourselves...
*/
-- If it's greater than the threshold or a statistic we are interested in,
-- then output it. The downside of using purely associative arrays is that
-- we don't have any easy way of sorting. So we have to do it ourselves...
-- -----------------------------------------------------------------------
if (p_threshold is not null and abs(v_value) >= p_threshold)
or (p_statnames is not empty and v_name member of p_statnames)
or (p_statname_like is not null and v_name like '%'||p_statname_like||'%')
or (p_statname_like is not null and v_name like '%'||p_statname_like||'%') or (p_statname_regexp is not null and regexp_like(v_name, p_statname_regexp, 'i'))
then
-- Fix for bug 1713403. If redo goes over 2Gb then it is reported as a negative
-- number. Recommended workaround (prior to fix in 10g) is to use redo blocks written
Expand All @@ -404,9 +402,9 @@ create or replace package body mystats_pkg as
end if;
end if;

/*
|| Next statname please...
*/

-- Next statname please...
-- -----------------------
v_name := ga_mystats(c_run1).next(v_name);

end loop;
Expand Down Expand Up @@ -470,7 +468,7 @@ create or replace package body mystats_pkg as
g_start_time := null;
g_end_time := null;
g_include_statistics := null;
g_include_latches := null;
g_include_latches := null;
g_include_time_model := null;
end ms_reset;

Expand Down Expand Up @@ -499,6 +497,8 @@ create or replace package body mystats_pkg as
then ms_report(p_statnames => p_statnames);
when p_statname_like is not null
then ms_report(p_statname_like => p_statname_like);
when p_statname_regexp is not null
then ms_report(p_statname_regexp => p_statname_regexp);
else ms_report;
end case;
ms_reset;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.