This site has been destroyed by Google forced upgrade to new way of WEB site.
All files links are not working. Many images has been lost in conversation.
Have to edit 190 pages manually. Will try to do ASAP but for this I need time ...
THANK YOU GOOGLE !

Thursday, September 26, 2013

Partition tool

In last period I was dealing with huge amount of partition based tables as well as ordinary table which should be converted to partition tables. Analyzing them and their structure and data and reorganizing their structure to achieve better performance was a main goal. For that task I was having all the time some repeating tasks so I decided to write a small package who will help me in this job. So this is how partition_tools was born.

Partition_tools package

Package was run against 10 and 11 g database but I assume it could run against any db version. This package has in fact two main functionality:
  • Count number of records in partition table on several ways
  • Function which will help me generating equal number of buckets for some data set
The source of that package is bellow.
CREATE OR REPLACE PACKAGE partition_tools
/* $Header: partition_tools 1.00 09/23/2013 13:13 damirv $ */

/*-------------------------------------------------------------------------------------------------------------------- 
 NAME    : partition_tools
 PURPOSE : procedure that are used with partitions ... tuning and analyzing
 
 Date    : 23.09.2013.
 Author  : Damir Vadas, damir.vadas@gmail.com

 Remarks : Package was run against 10 and 11 g database but I assume it could run against any db version. 
          
 Changes (DD.MM.YYYY, Name, CR/TR#):
-------------------------------------------------------------------------------------------------------------------- */
AUTHID CURRENT_USER
IS

  PROCEDURE recs_in_partition (p_partitions VARCHAR2, 
                              p_part_table_owner VARCHAR2, 
                              p_part_table_name VARCHAR2,
                              p_from_statistic VARCHAR2 DEFAULT 'N' -- Y -> read num_rows from statistic (all_tab_partitions) QUICKER!
                                                                    -- N -> dinamically execute sql and get real number of rows
            );

  FUNCTION recs_in_partition (p_partitions VARCHAR2, 
                             p_part_table_owner VARCHAR2, 
                             p_part_table_name VARCHAR2,
                             p_from_statistic VARCHAR2 DEFAULT 'N'
           ) RETURN VARCHAR2;

  FUNCTION running_sum_with_reset(
                                  p_rownum NUMBER,
                                  p_value    NUMBER,
                                  p_break_limit  NUMBER,
                                  p_reset_value  NUMBER DEFAULT 0
           ) RETURN NUMBER;

  FUNCTION running_sum_with_reset (
                                   p_rownum NUMBER,              
                                   p_value    NUMBER,                  -- current value that is added to sum
                                   p_break_limit  NUMBER,              -- initial partition width (bucket)
                                   p_reset_value  NUMBER,              -- when break come what value should running sum get  
                                   p_max_percentage NUMBER             -- percentage in which bucket values may fall upper bound 
           ) RETURN NUMBER;
END partition_tools;
/

CREATE OR REPLACE PACKAGE BODY partition_tools
IS  
  g_sum NUMBER;
  g_max_treshold NUMBER;
  --
  CURSOR c1 (cp_part_table_owner IN VARCHAR2, cp_part_table_name IN VARCHAR2) 
  IS
      SELECT table_name, partition_name
        FROM all_tab_partitions
       WHERE TABLE_OWNER = cp_part_table_owner AND table_name = cp_part_table_name 
    ORDER BY partition_position
  ;
  --    
  CURSOR c2 (cp_part_table_owner IN VARCHAR2, cp_part_table_name IN VARCHAR2, cp_start IN PLS_INTEGER, cp_end IN PLS_INTEGER)
  IS
      SELECT rownum rn, table_name, partition_name
        FROM all_tab_partitions
       WHERE TABLE_OWNER = cp_part_table_owner AND TABLE_NAME = cp_part_table_name and PARTITION_POSITION BETWEEN cp_start and cp_end 
    ORDER BY PARTITION_POSITION 
  ;
    l_partitions1 NUMBER; 
    l_partitions2 NUMBER;
  --
  CURSOR cs1  (cp_part_table_owner IN VARCHAR2, cp_part_table_name IN VARCHAR2) 
  IS
      SELECT partition_name, num_rows
        FROM all_tab_partitions
       WHERE TABLE_OWNER = cp_part_table_owner AND table_name = cp_part_table_name 
    ORDER BY partition_position
  ;
  --
  CURSOR cs2 (cp_part_table_owner IN VARCHAR2, cp_part_table_name IN VARCHAR2, cp_start IN PLS_INTEGER, cp_end IN PLS_INTEGER) 
  IS
      SELECT partition_name, num_rows
        FROM all_tab_partitions
       WHERE TABLE_OWNER = cp_part_table_owner AND table_name = cp_part_table_name and PARTITION_POSITION BETWEEN cp_start and cp_end 
    ORDER BY PARTITION_POSITION 
  ;
  --
  CURSOR cs3  (cp_part_table_owner IN VARCHAR2, cp_part_table_name IN VARCHAR2, cp_partition_name IN VARCHAR2 ) 
  IS
      SELECT partition_name, num_rows
        FROM all_tab_partitions
       WHERE TABLE_OWNER = cp_part_table_owner AND table_name = cp_part_table_name AND partition_name = cp_partition_name
  ;
  --       
  FUNCTION is_number (
            char_in VARCHAR2
          ) RETURN BOOLEAN
  IS
    n  NUMBER;
  BEGIN
    n := TO_NUMBER(nvl(char_in,'a'));
    RETURN TRUE;
  EXCEPTION
    WHEN OTHERS THEN
      RETURN FALSE;
  END is_number; 
  -- 
  PROCEDURE recs_in_partition (
                              p_partitions VARCHAR2, 
                              p_part_table_owner VARCHAR2, 
                              p_part_table_name VARCHAR2,
                              p_from_statistic VARCHAR2 DEFAULT 'N'
                             )
  IS       
    l_chartab sys.DBMS_DEBUG_VC2COLL := sys.DBMS_DEBUG_VC2COLL();
    l_temp_var   NUMBER := 0;
    l_partition_counter NUMBER DEFAULT 0;
    --
  BEGIN
    BEGIN
      SELECT column_value 
        BULK COLLECT 
          INTO l_chartab 
          FROM TABLE(tools.list2table(p_partitions));
      CASE l_chartab.COUNT
        WHEN 2 THEN  -- maybe a number range is a parameter (it may be two partitions!!)
          CASE 
            WHEN is_number(l_chartab(1)) AND is_number(l_chartab(2)) THEN -- not a prtition name because it cannot be a nnumber!
              l_partitions1 := l_chartab(1);
              l_partitions2 := l_chartab(2);
            ELSE
              l_partitions1 := -1;
              l_partitions1 := -2;
          END CASE;
        ELSE
          l_partitions1 := -1;
          l_partitions1 := -2;
      END CASE;
    EXCEPTION
      WHEN OTHERS THEN
        l_partitions1 := -1;
        l_partitions2 := -2;
    END;
    --
    CASE 
      WHEN p_partitions = 'ALL' THEN 
        CASE p_from_statistic 
          WHEN 'Y' THEN
            FOR rec IN cs1 (p_part_table_owner,p_part_table_name) LOOP
              DBMS_OUTPUT.put_line (rec.partition_name || '=' || LPAD (rec.num_rows, 12, ' ') || ' rows');
            END LOOP;      
          ELSE
            FOR rec IN c1 (p_part_table_owner,p_part_table_name) LOOP          
              EXECUTE IMMEDIATE 'select count(*) from ' ||p_part_table_owner||'.' || rec.table_name || ' partition(' || rec.partition_name || ')' INTO l_temp_var;
              DBMS_OUTPUT.put_line (rec.partition_name || '=' || LPAD (l_temp_var, 12, ' ') || ' rows');
            END LOOP;       
        END CASE;        
      WHEN l_partitions1 > 0 THEN 
        CASE p_from_statistic 
          WHEN 'Y' THEN
            FOR rec IN cs2 (p_part_table_owner,p_part_table_name, l_partitions1, (l_partitions1+l_partitions2) ) LOOP 
              CASE
                WHEN l_partitions2 > l_partition_counter THEN
                  DBMS_OUTPUT.put_line (rec.partition_name || '=' || LPAD (rec.num_rows, 12, ' ') || ' rows');
                  l_partition_counter := l_partition_counter+1;                              
                ELSE        
                  EXIT;
              END CASE;
            END LOOP;
          ELSE      
            FOR rec IN c2 (p_part_table_owner,p_part_table_name, l_partitions1, (l_partitions1+l_partitions2) ) LOOP 
              CASE
                WHEN l_partitions2 > l_partition_counter THEN                  
                  EXECUTE IMMEDIATE 'select count(*) from ' ||p_part_table_owner||'.' || rec.table_name || ' partition(' || rec.partition_name || ')' INTO l_temp_var;
                  DBMS_OUTPUT.put_line (rec.partition_name || '=' || LPAD (l_temp_var, 12, ' ') || ' rows');
                  l_partition_counter := l_partition_counter+1;
                ELSE        
                  EXIT;
              END CASE;
            END LOOP;
        END CASE;
      ELSE -- list of partitions delimited with ","
        SELECT column_value 
        BULK COLLECT 
          INTO l_chartab 
          FROM TABLE(tools.list2table(p_partitions));
        CASE p_from_statistic 
          WHEN 'Y' THEN
            FOR i IN 1 .. l_chartab.COUNT LOOP
              FOR rec IN cs3 (p_part_table_owner,p_part_table_name,l_chartab(i)) LOOP              
                DBMS_OUTPUT.put_line (l_chartab(i)|| '=' || LPAD (rec.num_rows, 12, ' ') || ' rows');
              END LOOP;
            END LOOP;
          ELSE
            FOR i IN 1 .. l_chartab.COUNT LOOP
              EXECUTE IMMEDIATE 'select count(*) from ' ||p_part_table_owner||'.' || p_part_table_name || ' partition(' || l_chartab(i) || ') ' INTO l_temp_var;
              DBMS_OUTPUT.put_line (l_chartab(i) || '=' || LPAD (l_temp_var, 12, ' ') || ' rows');
            END LOOP;
        END CASE;
    END CASE;
    DBMS_SESSION.FREE_UNUSED_USER_MEMORY;
  END;
  --
  FUNCTION recs_in_partition (
                             p_partitions VARCHAR2, 
                             p_part_table_owner VARCHAR2, 
                             p_part_table_name VARCHAR2,
                             p_from_statistic VARCHAR2 DEFAULT 'N'
                            ) RETURN VARCHAR2
  IS
    l_retval     VARCHAR2 (32000);      
    l_chartab sys.DBMS_DEBUG_VC2COLL := sys.DBMS_DEBUG_VC2COLL();
    l_temp_var   NUMBER := 0;
    l_partition_counter NUMBER DEFAULT 0;
    --
  BEGIN
    l_retVal := '';
    BEGIN
      SELECT column_value 
        BULK COLLECT 
          INTO l_chartab 
          FROM TABLE(tools.list2table(p_partitions));
      CASE l_chartab.COUNT
        WHEN 2 THEN  -- maybe a number range is a parameter (it may be two partitions!!)
          CASE 
            WHEN is_number(l_chartab(1)) AND is_number(l_chartab(2)) THEN -- not a prtition name because it cannot be a nnumber!
              l_partitions1 := l_chartab(1);
              l_partitions2 := l_chartab(2);
            ELSE
              l_partitions1 := -1;
              l_partitions1 := -2;
          END CASE;
        ELSE
          l_partitions1 := -1;
          l_partitions1 := -2;
      END CASE;
    EXCEPTION
      WHEN OTHERS THEN
        l_partitions1 := -1;
        l_partitions2 := -2;
    END;
    --
    CASE 
      WHEN p_partitions = 'ALL' THEN 
        CASE p_from_statistic 
          WHEN 'Y' THEN
            FOR rec IN cs1 (p_part_table_owner,p_part_table_name) LOOP
              l_retVal := l_retVal || rec.num_rows || ',';
            END LOOP;      
          ELSE
            FOR rec IN c1 (p_part_table_owner,p_part_table_name) LOOP          
              EXECUTE IMMEDIATE 'select count(*) from ' ||p_part_table_owner||'.' || rec.table_name || ' partition(' || rec.partition_name || ')' INTO l_temp_var;
              l_retVal := l_retVal || l_temp_var || ','; 
            END LOOP;       
        END CASE;        
      WHEN l_partitions1 > 0 THEN 
        CASE p_from_statistic 
          WHEN 'Y' THEN
            FOR rec IN cs2 (p_part_table_owner,p_part_table_name, l_partitions1, (l_partitions1+l_partitions2) ) LOOP 
              CASE
                WHEN l_partitions2 > l_partition_counter THEN
                  l_retVal := l_retVal || rec.num_rows || ',';
                  l_partition_counter := l_partition_counter+1;                              
                ELSE        
                  EXIT;
              END CASE;
            END LOOP;
          ELSE      
            FOR rec IN c2 (p_part_table_owner,p_part_table_name, l_partitions1, (l_partitions1+l_partitions2) ) LOOP 
              CASE
                WHEN l_partitions2 > l_partition_counter THEN                  
                  EXECUTE IMMEDIATE 'select count(*) from ' ||p_part_table_owner||'.' || rec.table_name || ' partition(' || rec.partition_name || ')' INTO l_temp_var;
                  l_retVal := l_retVal || l_temp_var || ',' ;
                  l_partition_counter := l_partition_counter+1;
                ELSE        
                  EXIT;
              END CASE;
            END LOOP;
        END CASE;
      ELSE -- list of partitions delimited with ","
        SELECT column_value 
        BULK COLLECT 
          INTO l_chartab 
          FROM TABLE(tools.list2table(p_partitions));
        CASE p_from_statistic 
          WHEN 'Y' THEN
            FOR i IN 1 .. l_chartab.COUNT LOOP
              FOR rec IN cs3 (p_part_table_owner,p_part_table_name,l_chartab(i)) LOOP              
                l_retVal := l_retVal || rec.num_rows || ',';
              END LOOP;
            END LOOP;
          ELSE
            FOR i IN 1 .. l_chartab.COUNT LOOP
              EXECUTE IMMEDIATE 'select count(*) from ' ||p_part_table_owner||'.' || p_part_table_name || ' partition(' || l_chartab(i) || ') ' INTO l_temp_var;
              l_retVal := l_retVal || l_temp_var || ',';
            END LOOP;
        END CASE;
    END CASE;
    DBMS_SESSION.FREE_UNUSED_USER_MEMORY;
    return substr(l_retVal,1,(Length(l_retVal)-1));
  END recs_in_partition;
  --
  FUNCTION running_sum_with_reset(
                                  p_rownum NUMBER,
                                  p_value    NUMBER,
                                  p_break_limit  NUMBER,
                                  p_reset_value  NUMBER DEFAULT 0
           ) RETURN NUMBER
  IS
  BEGIN
    IF p_rownum = 1 THEN
       g_sum := p_value;
    ELSE
       g_sum := g_sum + p_value;
    END IF;
    --
    IF g_sum >= p_break_limit THEN
       g_sum := p_reset_value;
    END IF;
    --
    RETURN g_sum;
  END running_sum_with_reset; 

  FUNCTION running_sum_with_reset(
                                  p_rownum NUMBER,
                                  p_value    NUMBER,
                                  p_break_limit  NUMBER,
                                  p_reset_value  NUMBER,
                                  p_max_percentage NUMBER
          ) RETURN NUMBER
  IS
  BEGIN
    IF p_rownum = 1 THEN
      -- assign only ones -- speed!
      g_sum := p_value;
      g_max_treshold := p_break_limit * p_max_percentage;
    ELSE
      g_sum := g_sum + p_value;
    END IF;
    --
    IF (g_sum >= g_max_treshold ) THEN
      g_sum := p_reset_value;
    END IF;
    --
    RETURN g_sum;
  END running_sum_with_reset; 
END partition_tools;
/
In this blog I'll explain just first functionality, because for second one I'll create additional blog.

partition_tools.recs_in_partition

p_partitions parameter define range of partition table which should be analyzed. It may have three kind of values:
  1. ALL-means all partitions
  2. 'x,y'-where x and y are numbers which defines x=partition_position and y=number of partitions from x (range defined with numbers)...i.e. '10,10'
  3. 'a,b,c,...x)' comma separated list of partition names i.e. 'FUTURE_COST_P01310100,FUTURE_COST_P01310147'
p_part_table_owner and p_part_table_name are self explainary. p_from_statistic parameter define how number of records will be counted.
  1. 'N' (default)-count(*), takes more time but it's fully accurate
  2. 'Y' (default)-num_rows from all_tab_partitions, may be inaccurate in lack of statistic
With mentioned parameters, I was able to analyze all situations in mine work. There are two methods with same name, one is procedure and other is function. In basic their functionality is similar (based on same parameters) but usage is for different need.

Procedure

Here is explanation of procedure, which seems to me self explicable examples. ALL parameter in action:
set serveroutput on size 1000000;
exec tools.partition_tools.recs_in_partiton ('ALL', 'RMS','FUTURE_COST2');
result is here (hidden because of complexity):
FUTURE_COST_P01310100=       62688 rows
FUTURE_COST_P01310147=       59039 rows
FUTURE_COST_P01310472=       64983 rows
FUTURE_COST_P01310670=       53864 rows
FUTURE_COST_P01310710=       63665 rows
FUTURE_COST_P01310866=       45531 rows
FUTURE_COST_P01310976=       64812 rows
FUTURE_COST_P01311347=       64988 rows
FUTURE_COST_P01318017=       64572 rows
FUTURE_COST_P01400049=       65053 rows
FUTURE_COST_P01400081=       47488 rows
FUTURE_COST_P01400101=       65048 rows
FUTURE_COST_P01400318=       64828 rows
FUTURE_COST_P01400955=       58633 rows
FUTURE_COST_P01401572=       54898 rows
FUTURE_COST_P01401747=       61498 rows
FUTURE_COST_P01401776=       27070 rows
FUTURE_COST_P01401925=       60750 rows
FUTURE_COST_P01402186=       63320 rows
FUTURE_COST_P01402681=       60469 rows
FUTURE_COST_P01403009=       64484 rows
FUTURE_COST_P01405646=       54671 rows
FUTURE_COST_P01405772=       43056 rows
FUTURE_COST_P01407876=       64162 rows
FUTURE_COST_P01409451=       57327 rows
FUTURE_COST_P01410026=       52551 rows
FUTURE_COST_P01410068=       57736 rows
FUTURE_COST_P01410076=       55239 rows
FUTURE_COST_P01410096=       64189 rows
FUTURE_COST_P01410157=       56462 rows
FUTURE_COST_P01410437=       62708 rows
FUTURE_COST_P01410754=       65124 rows
FUTURE_COST_P01411106=       63956 rows
FUTURE_COST_P01411533=       64615 rows
FUTURE_COST_P01411575=       48245 rows
FUTURE_COST_P01411805=       57494 rows
FUTURE_COST_P01413000=       54538 rows
FUTURE_COST_P01413435=       63114 rows
FUTURE_COST_P01414585=       60594 rows
FUTURE_COST_P01415020=       60899 rows
FUTURE_COST_P01415073=       64938 rows
FUTURE_COST_P01465029=       64885 rows
FUTURE_COST_P01471561=       57425 rows
FUTURE_COST_P01480212=       64270 rows
FUTURE_COST_P01490071=       61525 rows
FUTURE_COST_P01490207=       65108 rows
FUTURE_COST_P01490571=       62466 rows
FUTURE_COST_P01491261=       57654 rows
FUTURE_COST_P01491658=       63460 rows
FUTURE_COST_P01495137=       64811 rows
FUTURE_COST_P01499951=       64852 rows
FUTURE_COST_P01500540=       65072 rows
FUTURE_COST_P01506016=       64507 rows
FUTURE_COST_P01516018=       65127 rows
FUTURE_COST_P01520999=       62987 rows
FUTURE_COST_P01530158=       61611 rows
FUTURE_COST_P01550509=       64150 rows
FUTURE_COST_P01551129=       65108 rows
FUTURE_COST_P01560314=       64003 rows
FUTURE_COST_P01570173=       64763 rows
FUTURE_COST_P01570909=       62249 rows
FUTURE_COST_P01571119=       58721 rows
FUTURE_COST_P01580211=       59372 rows
FUTURE_COST_P01590427=       65138 rows
FUTURE_COST_P01630415=       64200 rows
FUTURE_COST_P01640222=       64377 rows
FUTURE_COST_P01640558=       64735 rows
FUTURE_COST_P01641066=       56771 rows
FUTURE_COST_P01641662=       65005 rows
FUTURE_COST_P01642175=       58755 rows
FUTURE_COST_P01642186=       64015 rows
FUTURE_COST_P01645050=       60236 rows
FUTURE_COST_P01645057=       56436 rows
FUTURE_COST_P01647049=       63996 rows
FUTURE_COST_P02000016=       65152 rows
FUTURE_COST_P02000050=       64406 rows
FUTURE_COST_P02000085=       64034 rows
FUTURE_COST_P02000127=       64945 rows
FUTURE_COST_P02000165=       64327 rows
FUTURE_COST_P02000199=       63884 rows
FUTURE_COST_P02000246=       63999 rows
FUTURE_COST_P02000298=       63210 rows
FUTURE_COST_P02016375=       65116 rows
FUTURE_COST_P02018139=       52749 rows
FUTURE_COST_P02019021=       65181 rows
FUTURE_COST_P02020582=       60958 rows
FUTURE_COST_P02024385=       60334 rows
FUTURE_COST_P02024461=       59632 rows
FUTURE_COST_P02024474=       63306 rows
FUTURE_COST_P02030066=       57158 rows
FUTURE_COST_P02033172=       60593 rows
FUTURE_COST_P02034493=       57347 rows
FUTURE_COST_P02034524=       59212 rows
FUTURE_COST_P02036480=       55246 rows
FUTURE_COST_P02036546=       60027 rows
FUTURE_COST_P02038050=       65121 rows
FUTURE_COST_P02039238=       64334 rows
FUTURE_COST_P02039608=       65035 rows
FUTURE_COST_P02044187=       61139 rows
FUTURE_COST_P02044220=       31682 rows
FUTURE_COST_P02044269=       65046 rows
FUTURE_COST_P02044317=       59506 rows
FUTURE_COST_P02048427=       63321 rows
FUTURE_COST_P02048523=       64024 rows
FUTURE_COST_P02050951=       56445 rows
FUTURE_COST_P02052991=       64266 rows
FUTURE_COST_P02053638=       53982 rows
FUTURE_COST_P02053791=       63437 rows
FUTURE_COST_P02053863=       57101 rows
FUTURE_COST_P02053911=       52686 rows
FUTURE_COST_P02055093=       58965 rows
FUTURE_COST_P02055427=       65135 rows
FUTURE_COST_P02100610=       58958 rows
FUTURE_COST_P02103000=       64929 rows
FUTURE_COST_P02103168=       62685 rows
FUTURE_COST_P02160058=       60984 rows
FUTURE_COST_P02160317=       63145 rows
FUTURE_COST_P02160874=       64482 rows
FUTURE_COST_P02161114=       60726 rows
FUTURE_COST_P02164313=       65021 rows
FUTURE_COST_P02166664=       60916 rows
FUTURE_COST_P02169533=       63571 rows
FUTURE_COST_P02180313=       64661 rows
FUTURE_COST_P02190138=       64349 rows
FUTURE_COST_P02190355=       61670 rows
FUTURE_COST_P02191045=       64191 rows
FUTURE_COST_P02193592=       65089 rows
FUTURE_COST_P02195129=       59824 rows
FUTURE_COST_P02195487=       61634 rows
FUTURE_COST_P02197068=       64973 rows
FUTURE_COST_P02197556=       55630 rows
FUTURE_COST_P02197789=       64252 rows
FUTURE_COST_P02198000=       60642 rows
FUTURE_COST_P02198570=       64540 rows
FUTURE_COST_P02198859=       61879 rows
FUTURE_COST_P02199460=       64279 rows
FUTURE_COST_P02200074=       63905 rows
FUTURE_COST_P02202048=       54359 rows
FUTURE_COST_P02202141=       63080 rows
FUTURE_COST_P02210243=       64291 rows
FUTURE_COST_P02230108=       63907 rows
FUTURE_COST_P02230426=       62159 rows
FUTURE_COST_P02231012=       63664 rows
FUTURE_COST_P02233988=       62282 rows
FUTURE_COST_P02234024=       62264 rows
FUTURE_COST_P02320022=       63729 rows
FUTURE_COST_P02320982=       61925 rows
FUTURE_COST_P02324049=       51847 rows
FUTURE_COST_P02324214=       33123 rows
FUTURE_COST_P02329035=       61707 rows
FUTURE_COST_P02329055=       63940 rows
FUTURE_COST_P02330097=       63742 rows
FUTURE_COST_P02330670=       65136 rows
FUTURE_COST_P02330941=       64587 rows
FUTURE_COST_P02331098=       58149 rows
FUTURE_COST_P02331182=       61313 rows
FUTURE_COST_P02331227=       59528 rows
FUTURE_COST_P02331243=       65047 rows
FUTURE_COST_P02334070=       62334 rows
FUTURE_COST_P02334105=       26048 rows
FUTURE_COST_P02334114=       63922 rows
FUTURE_COST_P02334192=       65018 rows
FUTURE_COST_P02334248=       59577 rows
FUTURE_COST_P02334291=       65052 rows
FUTURE_COST_P02334305=       65169 rows
FUTURE_COST_P02334649=       62288 rows
FUTURE_COST_P02334692=       64989 rows
FUTURE_COST_P02350060=       57718 rows
FUTURE_COST_P02350635=       64826 rows
FUTURE_COST_P02350952=       51014 rows
FUTURE_COST_P02351153=       59166 rows
FUTURE_COST_P02351378=       64534 rows
FUTURE_COST_P02351413=       62757 rows
FUTURE_COST_P02351432=       64917 rows
FUTURE_COST_P02360015=       64333 rows
FUTURE_COST_P02360031=       59455 rows
FUTURE_COST_P02361437=       64365 rows
FUTURE_COST_P02361569=       61518 rows
FUTURE_COST_P02370042=       63195 rows
FUTURE_COST_P02370484=       63446 rows
FUTURE_COST_P02371057=       64487 rows
FUTURE_COST_P02371190=       63574 rows
FUTURE_COST_P02371545=       61436 rows
FUTURE_COST_P02371643=       64401 rows
FUTURE_COST_P02371689=       64802 rows
FUTURE_COST_P02373388=       65144 rows
FUTURE_COST_P02373515=       62695 rows
FUTURE_COST_P02373596=       65193 rows
FUTURE_COST_P02373673=       65142 rows
FUTURE_COST_P02373752=       65161 rows
FUTURE_COST_P02373819=       62277 rows
FUTURE_COST_P02373866=       64974 rows
FUTURE_COST_P02390054=       59603 rows
FUTURE_COST_P02390943=       53738 rows
FUTURE_COST_P02398927=       61621 rows
FUTURE_COST_P02398939=       26544 rows
FUTURE_COST_P02398953=       62125 rows
FUTURE_COST_P02400067=       58418 rows
FUTURE_COST_P02401110=       64357 rows
FUTURE_COST_P02402389=       54746 rows
FUTURE_COST_P02403738=       64883 rows
FUTURE_COST_P02404064=       58518 rows
FUTURE_COST_P02404264=       61868 rows
FUTURE_COST_P02404343=       65134 rows
FUTURE_COST_P02410037=       59762 rows
FUTURE_COST_P02412502=       61745 rows
FUTURE_COST_P02420374=       65175 rows
FUTURE_COST_P02434234=       58802 rows
FUTURE_COST_P02435423=       64919 rows
FUTURE_COST_P02435538=       62384 rows
FUTURE_COST_P02451396=       62768 rows
FUTURE_COST_P02481558=       64855 rows
FUTURE_COST_P02510669=       64243 rows
FUTURE_COST_P02520864=       65167 rows
FUTURE_COST_P03010028=       46661 rows
FUTURE_COST_P03010068=       46660 rows
FUTURE_COST_P03010099=       46379 rows
FUTURE_COST_P03010523=       61650 rows
FUTURE_COST_P03011099=       60280 rows
FUTURE_COST_P03012134=       60134 rows
FUTURE_COST_P03015515=       39126 rows
FUTURE_COST_P03019119=       64955 rows
FUTURE_COST_P03019126=       61711 rows
FUTURE_COST_P03020152=       64764 rows
FUTURE_COST_P03020305=       61703 rows
FUTURE_COST_P03020815=       64470 rows
FUTURE_COST_P03021154=       50542 rows
FUTURE_COST_P03021509=       65172 rows
FUTURE_COST_P03021807=       60792 rows
FUTURE_COST_P03022519=       57913 rows
FUTURE_COST_P03023632=       65191 rows
FUTURE_COST_P03030019=       61705 rows
FUTURE_COST_P03040039=       57701 rows
FUTURE_COST_P03041225=       64922 rows
FUTURE_COST_P03063930=       65029 rows
FUTURE_COST_P03070244=       64286 rows
FUTURE_COST_P03070781=       62558 rows
FUTURE_COST_P03071689=       64331 rows
FUTURE_COST_P03080197=       64748 rows
FUTURE_COST_P03082001=       65172 rows
FUTURE_COST_P03120013=       57778 rows
FUTURE_COST_P03120084=       63071 rows
FUTURE_COST_P03120398=       64864 rows
FUTURE_COST_P03130061=       65090 rows
FUTURE_COST_P03130540=       64902 rows
FUTURE_COST_P03130741=       65167 rows
FUTURE_COST_P03131126=       63920 rows
FUTURE_COST_P03131475=       46589 rows
FUTURE_COST_P03140014=       63558 rows
FUTURE_COST_P03140033=       60399 rows
FUTURE_COST_P03140121=       62307 rows
FUTURE_COST_P03140285=       63455 rows
FUTURE_COST_P03140420=       64273 rows
FUTURE_COST_P03140535=       61755 rows
FUTURE_COST_P03140893=       65115 rows
FUTURE_COST_P03141209=       62496 rows
FUTURE_COST_P03141291=       64407 rows
FUTURE_COST_P03142020=       61920 rows
FUTURE_COST_P03142663=       64284 rows
FUTURE_COST_P03145075=       64397 rows
FUTURE_COST_P03148047=       64959 rows
FUTURE_COST_P03150290=       65179 rows
FUTURE_COST_P03160062=       64185 rows
FUTURE_COST_P03160268=       52911 rows
FUTURE_COST_P03160285=       62047 rows
FUTURE_COST_P03160760=       63940 rows
FUTURE_COST_P03160957=       65114 rows
FUTURE_COST_P03162916=       62135 rows
FUTURE_COST_P03163559=       64829 rows
FUTURE_COST_P03164131=       64830 rows
FUTURE_COST_P03167049=       61301 rows
FUTURE_COST_P03167512=       56056 rows
FUTURE_COST_P03170365=       64241 rows
FUTURE_COST_P03170659=       58210 rows
FUTURE_COST_P03172249=       64450 rows
FUTURE_COST_P03180015=       62129 rows
FUTURE_COST_P03180171=       58585 rows
FUTURE_COST_P03182016=       64297 rows
FUTURE_COST_P03210009=       58388 rows
FUTURE_COST_P03210094=       63820 rows
FUTURE_COST_P03210386=       59452 rows
FUTURE_COST_P03220065=       53981 rows
FUTURE_COST_P03250931=       64527 rows
FUTURE_COST_P03251709=       63179 rows
FUTURE_COST_P03280154=       64533 rows
FUTURE_COST_P04010004=       64876 rows
FUTURE_COST_P04010059=       65109 rows
FUTURE_COST_P04010235=       62215 rows
FUTURE_COST_P04010841=       64793 rows
FUTURE_COST_P04011681=       64735 rows
FUTURE_COST_P04012621=       65145 rows
FUTURE_COST_P04014287=       65168 rows
FUTURE_COST_P04015169=       65079 rows
FUTURE_COST_P04015686=       64033 rows
FUTURE_COST_P04015771=       47218 rows
FUTURE_COST_P04015773=       55559 rows
FUTURE_COST_P04015825=       61269 rows
FUTURE_COST_P04016131=       65095 rows
FUTURE_COST_P04016338=       64580 rows
FUTURE_COST_P04016497=       61824 rows
FUTURE_COST_P04019736=       56222 rows
FUTURE_COST_P04019978=       64942 rows
FUTURE_COST_P04020468=       63819 rows
FUTURE_COST_P04020476=       38453 rows
FUTURE_COST_P04021030=       65051 rows
FUTURE_COST_P04022141=       65147 rows
FUTURE_COST_P04022591=       60558 rows
FUTURE_COST_P04023834=       65001 rows
FUTURE_COST_P04024486=       65183 rows
FUTURE_COST_P04024929=       64934 rows
FUTURE_COST_P04025157=       64888 rows
FUTURE_COST_P04025328=       64246 rows
FUTURE_COST_P04025513=       65182 rows
FUTURE_COST_P04027594=       65018 rows
FUTURE_COST_P04028124=       60737 rows
FUTURE_COST_P04029192=       65064 rows
FUTURE_COST_P04030001=       61864 rows
FUTURE_COST_P04030101=       64955 rows
FUTURE_COST_P04030487=       59399 rows
FUTURE_COST_P04030973=       64264 rows
FUTURE_COST_P04031817=       58929 rows
FUTURE_COST_P04039526=       64380 rows
FUTURE_COST_P04050176=       65153 rows
FUTURE_COST_P04050183=       65058 rows
FUTURE_COST_P04050189=       63563 rows
FUTURE_COST_P04050192=       45536 rows
FUTURE_COST_P04050323=       41915 rows
FUTURE_COST_P04050364=       64867 rows
FUTURE_COST_P04050521=       65016 rows
FUTURE_COST_P04050693=       63978 rows
FUTURE_COST_P04050850=       65045 rows
FUTURE_COST_P04051110=       61658 rows
FUTURE_COST_P04051219=       65090 rows
FUTURE_COST_P04051337=       61590 rows
FUTURE_COST_P04051595=       61468 rows
FUTURE_COST_P04051601=       64514 rows
FUTURE_COST_P04052270=       63374 rows
FUTURE_COST_P04057602=       51903 rows
FUTURE_COST_P04057605=       54690 rows
FUTURE_COST_P04060006=       61387 rows
FUTURE_COST_P04060325=       65004 rows
FUTURE_COST_P04065118=       64116 rows
FUTURE_COST_P04070053=       63810 rows
FUTURE_COST_P04070059=       54552 rows
FUTURE_COST_P04070147=       59138 rows
FUTURE_COST_P04070240=       56479 rows
FUTURE_COST_P04070352=       51868 rows
FUTURE_COST_P04070405=       54836 rows
FUTURE_COST_P04070424=       57156 rows
FUTURE_COST_P04070785=       64660 rows
FUTURE_COST_P04071171=       65163 rows
FUTURE_COST_P04071847=       62703 rows
FUTURE_COST_P04072549=       64800 rows
FUTURE_COST_P04074064=       64181 rows
FUTURE_COST_P04090037=       64401 rows
FUTURE_COST_P04090336=       65159 rows
FUTURE_COST_P04091132=       64473 rows
FUTURE_COST_P04091493=       63560 rows
FUTURE_COST_P04091899=       64395 rows
FUTURE_COST_P04100095=       64939 rows
FUTURE_COST_P04100279=       63835 rows
FUTURE_COST_P04100613=       63529 rows
FUTURE_COST_P04102072=       63287 rows
FUTURE_COST_P04110024=       64007 rows
FUTURE_COST_P04121004=       64972 rows
FUTURE_COST_P04130415=       63078 rows
FUTURE_COST_P04140079=       64487 rows
FUTURE_COST_P04140309=       60325 rows
FUTURE_COST_P04140525=       63584 rows
FUTURE_COST_P04140744=       62949 rows
FUTURE_COST_P04140950=       64847 rows
FUTURE_COST_P04141134=       64985 rows
FUTURE_COST_P04141289=       62978 rows
FUTURE_COST_P04141574=       65039 rows
FUTURE_COST_P04141679=       61492 rows
FUTURE_COST_P04141714=       41007 rows
FUTURE_COST_P04141870=       63342 rows
FUTURE_COST_P04142200=       57861 rows
FUTURE_COST_P04142514=       63459 rows
FUTURE_COST_P04142723=       62155 rows
FUTURE_COST_P04143662=       61415 rows
FUTURE_COST_P04144059=       64780 rows
FUTURE_COST_P04146025=       55281 rows
FUTURE_COST_P04147510=       64204 rows
FUTURE_COST_P04149268=       64875 rows
FUTURE_COST_P04149698=       64878 rows
FUTURE_COST_P04150121=       37609 rows
FUTURE_COST_P04150462=       63030 rows
FUTURE_COST_P04150726=       58199 rows
FUTURE_COST_P04150975=       57537 rows
FUTURE_COST_P04151117=       58740 rows
FUTURE_COST_P04151208=       62117 rows
FUTURE_COST_P04151243=       63103 rows
FUTURE_COST_P04151412=       63125 rows
FUTURE_COST_P04151565=       62238 rows
FUTURE_COST_P04152222=       53613 rows
FUTURE_COST_P04152510=       60496 rows
FUTURE_COST_P04155008=       64774 rows
FUTURE_COST_P04160053=       64485 rows
FUTURE_COST_P04160209=       60470 rows
FUTURE_COST_P04160519=       62616 rows
FUTURE_COST_P04160905=       65157 rows
FUTURE_COST_P04161755=       60942 rows
FUTURE_COST_P04162591=       63049 rows
FUTURE_COST_P04162740=       64190 rows
FUTURE_COST_P04163635=       65149 rows
FUTURE_COST_P04169012=       57553 rows
FUTURE_COST_P04170320=       62261 rows
FUTURE_COST_P04170625=       64895 rows
FUTURE_COST_P04170929=       64871 rows
FUTURE_COST_P04171402=       60103 rows
FUTURE_COST_P04172528=       60744 rows
FUTURE_COST_P04173610=       64684 rows
FUTURE_COST_P04180009=       64423 rows
FUTURE_COST_P04180231=       65135 rows
FUTURE_COST_P04180533=       62269 rows
FUTURE_COST_P04180735=       60317 rows
FUTURE_COST_P04181017=       63787 rows
FUTURE_COST_P04181174=       65088 rows
FUTURE_COST_P04182740=       64653 rows
FUTURE_COST_P04183301=       59729 rows
FUTURE_COST_P04185911=       65044 rows
FUTURE_COST_P04190234=       65042 rows
FUTURE_COST_P04190477=       64028 rows
FUTURE_COST_P04191148=       61518 rows
FUTURE_COST_P04191609=       61930 rows
FUTURE_COST_P04191724=       59675 rows
FUTURE_COST_P04192474=       61987 rows
FUTURE_COST_P04193165=       62388 rows
FUTURE_COST_P04195374=       63852 rows
FUTURE_COST_P04199675=       64893 rows
FUTURE_COST_P04200960=       64638 rows
FUTURE_COST_P04207111=       63737 rows
FUTURE_COST_P04210068=       65175 rows
FUTURE_COST_P04210415=       58587 rows
FUTURE_COST_P04210630=       47139 rows
FUTURE_COST_P04210750=       65176 rows
FUTURE_COST_P04210993=       57809 rows
FUTURE_COST_P04211161=       59681 rows
FUTURE_COST_P04211277=       56156 rows
FUTURE_COST_P04211431=       64806 rows
FUTURE_COST_P04211545=       62679 rows
FUTURE_COST_P04211627=       62067 rows
FUTURE_COST_P04211711=       64788 rows
FUTURE_COST_P04211836=       65030 rows
FUTURE_COST_P04211925=       59948 rows
FUTURE_COST_P04212069=       61649 rows
FUTURE_COST_P04212250=       65107 rows
FUTURE_COST_P04212559=       63449 rows
FUTURE_COST_P04213337=       63966 rows
FUTURE_COST_P04217535=       64430 rows
FUTURE_COST_P04219658=       64748 rows
FUTURE_COST_P04220237=       64172 rows
FUTURE_COST_P04220705=       64328 rows
FUTURE_COST_P04221272=       60397 rows
FUTURE_COST_P04221432=       62492 rows
FUTURE_COST_P04221471=       60458 rows
FUTURE_COST_P04225011=       64018 rows
FUTURE_COST_P04230158=       62279 rows
FUTURE_COST_P04240125=       64885 rows
FUTURE_COST_P04250892=       62167 rows
FUTURE_COST_P04251566=       64473 rows
FUTURE_COST_P04280054=       64228 rows
FUTURE_COST_P04280172=       64942 rows
FUTURE_COST_P04280349=       65105 rows
FUTURE_COST_P04280421=       65084 rows
FUTURE_COST_P04331005=       62826 rows
FUTURE_COST_P04360188=       64152 rows
FUTURE_COST_P04410285=       64264 rows
FUTURE_COST_P05012099=       64815 rows
FUTURE_COST_P05030112=       65054 rows
FUTURE_COST_P05030800=       64931 rows
FUTURE_COST_P05031160=       65137 rows
FUTURE_COST_P05031712=       65139 rows
FUTURE_COST_P05032350=       63553 rows
FUTURE_COST_P05035154=       65102 rows
FUTURE_COST_P05040521=       64284 rows
FUTURE_COST_P05072996=       64787 rows
FUTURE_COST_P05080495=       29444 rows
FUTURE_COST_P05080694=       63889 rows
FUTURE_COST_P05081015=       63412 rows
FUTURE_COST_P05081781=       64472 rows
FUTURE_COST_P05082601=       63688 rows
FUTURE_COST_P05085543=       65190 rows
FUTURE_COST_P05089534=       61245 rows
FUTURE_COST_P05090431=       65190 rows
FUTURE_COST_P05092965=       65153 rows
FUTURE_COST_P05097127=       64165 rows
FUTURE_COST_P05102969=       64925 rows
FUTURE_COST_P05111067=       65182 rows
FUTURE_COST_P05121788=       65169 rows
FUTURE_COST_P05130100=       65188 rows
FUTURE_COST_P05182346=       61441 rows
FUTURE_COST_P05182951=       63354 rows
FUTURE_COST_P05183754=       65153 rows
FUTURE_COST_P05184704=       65165 rows
FUTURE_COST_P05210348=       64246 rows
FUTURE_COST_P05310222=       64797 rows
FUTURE_COST_P05311934=       64657 rows
FUTURE_COST_P05313685=       63425 rows
FUTURE_COST_P05315529=       64616 rows
FUTURE_COST_P05354984=       64625 rows
FUTURE_COST_P05411074=       64192 rows
FUTURE_COST_P05417551=       64848 rows
FUTURE_COST_P05420828=       65193 rows
FUTURE_COST_P05422496=       65168 rows
FUTURE_COST_P05441402=       65188 rows
FUTURE_COST_P05441652=       64465 rows
FUTURE_COST_P05443032=       64320 rows
FUTURE_COST_P05443102=       64441 rows
FUTURE_COST_P05443156=       64143 rows
FUTURE_COST_P05447552=       63697 rows
FUTURE_COST_P05447613=       65104 rows
FUTURE_COST_P05448000=       64769 rows
FUTURE_COST_P05448064=       64413 rows
FUTURE_COST_P05448150=       64733 rows
FUTURE_COST_P05448324=       64156 rows
FUTURE_COST_P05448410=       65021 rows
FUTURE_COST_P05448612=       64563 rows
FUTURE_COST_P05448806=       64359 rows
FUTURE_COST_P05448878=       64611 rows
FUTURE_COST_P05448946=       64154 rows
FUTURE_COST_P05449020=       64844 rows
FUTURE_COST_P05510412=       64365 rows
FUTURE_COST_P05520609=       63640 rows
FUTURE_COST_P05570137=       65020 rows
FUTURE_COST_P05610041=       65189 rows
FUTURE_COST_P05670634=       64858 rows
FUTURE_COST_P05672114=       65072 rows
FUTURE_COST_P05701671=       65173 rows
FUTURE_COST_P05702404=       65112 rows
FUTURE_COST_P05702577=       64993 rows
FUTURE_COST_P05702724=       65012 rows
FUTURE_COST_P05711615=       65186 rows
FUTURE_COST_P05772710=       65179 rows
FUTURE_COST_P05773616=       64914 rows
FUTURE_COST_P05773764=       64215 rows
FUTURE_COST_P05774512=       65082 rows
FUTURE_COST_P05775689=       64768 rows
FUTURE_COST_P05781000=       65176 rows
FUTURE_COST_P05811735=       65154 rows
FUTURE_COST_P05813268=       65178 rows
FUTURE_COST_P05813594=       64191 rows
FUTURE_COST_P05817542=       65184 rows
FUTURE_COST_P06013048=       64802 rows
FUTURE_COST_P06014921=       65180 rows
FUTURE_COST_P06021876=       65173 rows
FUTURE_COST_P06032338=       65188 rows
FUTURE_COST_P06050100=       64750 rows
FUTURE_COST_P06081602=       64680 rows
FUTURE_COST_P06100990=       64545 rows
FUTURE_COST_P06101332=       64832 rows
FUTURE_COST_P06112574=       64687 rows
FUTURE_COST_P06143028=       64906 rows
FUTURE_COST_P06152038=       65180 rows
FUTURE_COST_P06172974=       65162 rows
FUTURE_COST_P06183118=       64610 rows
FUTURE_COST_P06193549=       65180 rows
FUTURE_COST_P06201661=       65017 rows
FUTURE_COST_P06301055=       64950 rows
FUTURE_COST_P06462238=       65068 rows
FUTURE_COST_P06465267=       64979 rows
FUTURE_COST_P06466417=       64539 rows
FUTURE_COST_P06466839=       64946 rows
FUTURE_COST_P06467047=       64484 rows
FUTURE_COST_P06467207=       65084 rows
FUTURE_COST_P06467373=       64898 rows
FUTURE_COST_P06480953=       64856 rows
FUTURE_COST_P06481431=       65088 rows
FUTURE_COST_P06500031=       55061 rows
FUTURE_COST_P06500235=       65132 rows
FUTURE_COST_P06500278=       59955 rows
FUTURE_COST_P06500659=       61236 rows
FUTURE_COST_P06500832=       61295 rows
FUTURE_COST_P06501050=       58640 rows
FUTURE_COST_P06501367=       59529 rows
FUTURE_COST_P06502639=       61825 rows
FUTURE_COST_P06504148=       65163 rows
FUTURE_COST_P06510032=       53003 rows
FUTURE_COST_P06510167=       59408 rows
FUTURE_COST_P06510607=       62574 rows
FUTURE_COST_P06511388=       63143 rows
FUTURE_COST_P06513845=       59111 rows
FUTURE_COST_P06519005=       63569 rows
FUTURE_COST_P06520174=       63693 rows
FUTURE_COST_P06520352=       62372 rows
FUTURE_COST_P06520411=       57020 rows
FUTURE_COST_P06520549=       55735 rows
FUTURE_COST_P06520755=       63139 rows
FUTURE_COST_P06520828=       65124 rows
FUTURE_COST_P06520987=       64442 rows
FUTURE_COST_P06521093=       64017 rows
FUTURE_COST_P06521300=       64820 rows
FUTURE_COST_P06521368=       65139 rows
FUTURE_COST_P06521418=       64408 rows
FUTURE_COST_P06521656=       58696 rows
FUTURE_COST_P06521700=       57489 rows
FUTURE_COST_P06522719=       65189 rows
FUTURE_COST_P06524211=       65031 rows
FUTURE_COST_P06524230=       55468 rows
FUTURE_COST_P06525230=       64206 rows
FUTURE_COST_P06526186=       59531 rows
FUTURE_COST_P06529026=       64953 rows
FUTURE_COST_P06530155=       61836 rows
FUTURE_COST_P06530299=       60152 rows
FUTURE_COST_P06530374=       65085 rows
FUTURE_COST_P06530559=       58869 rows
FUTURE_COST_P06530694=       65175 rows
FUTURE_COST_P06531193=       62967 rows
FUTURE_COST_P06537553=       59052 rows
FUTURE_COST_P06540215=       61635 rows
FUTURE_COST_P06540387=       57894 rows
FUTURE_COST_P06540476=       64082 rows
FUTURE_COST_P06540610=       55769 rows
FUTURE_COST_P06540787=       64400 rows
FUTURE_COST_P06541076=       64943 rows
FUTURE_COST_P06541426=       63148 rows
FUTURE_COST_P06542047=       63940 rows
FUTURE_COST_P06542799=       62018 rows
FUTURE_COST_P06543379=       64389 rows
FUTURE_COST_P06544288=       64840 rows
FUTURE_COST_P06544364=       65129 rows
FUTURE_COST_P06548066=       63618 rows
FUTURE_COST_P06550080=       62139 rows
FUTURE_COST_P06550302=       61193 rows
FUTURE_COST_P06550532=       62791 rows
FUTURE_COST_P06550654=       64970 rows
FUTURE_COST_P06551143=       63037 rows
FUTURE_COST_P06552438=       65040 rows
FUTURE_COST_P06552590=       63084 rows
FUTURE_COST_P06552624=       59656 rows
FUTURE_COST_P06555059=       61916 rows
FUTURE_COST_P06555347=       65155 rows
FUTURE_COST_P06560148=       60895 rows
FUTURE_COST_P06560302=       64692 rows
FUTURE_COST_P06560937=       60976 rows
FUTURE_COST_P06562093=       64559 rows
FUTURE_COST_P06565041=       62964 rows
FUTURE_COST_P06574421=       65159 rows
FUTURE_COST_P06581417=       65014 rows
FUTURE_COST_P06583838=       65127 rows
FUTURE_COST_P06586234=       65054 rows
FUTURE_COST_P06587188=       65109 rows
FUTURE_COST_P06587870=       65008 rows
FUTURE_COST_P06588455=       65143 rows
FUTURE_COST_P06588902=       65159 rows
FUTURE_COST_P06589293=       65125 rows
FUTURE_COST_P06589805=       65157 rows
FUTURE_COST_P06590158=       59756 rows
FUTURE_COST_P06590439=       65182 rows
FUTURE_COST_P06591125=       64595 rows
FUTURE_COST_P06591574=       64991 rows
FUTURE_COST_P06592083=       63698 rows
FUTURE_COST_P06592271=       64662 rows
FUTURE_COST_P06592661=       59152 rows
FUTURE_COST_P06593031=       59835 rows
FUTURE_COST_P06593697=       64856 rows
FUTURE_COST_P06595748=       65183 rows
FUTURE_COST_P06596980=       62445 rows
FUTURE_COST_P06600056=       57497 rows
FUTURE_COST_P06600293=       65113 rows
FUTURE_COST_P06601058=       65015 rows
FUTURE_COST_P06601329=       61961 rows
FUTURE_COST_P06602617=       64600 rows
FUTURE_COST_P06615049=       64838 rows
FUTURE_COST_P06623634=       64994 rows
FUTURE_COST_P06630019=       62133 rows
FUTURE_COST_P06633081=       60691 rows
FUTURE_COST_P07000267=       64832 rows
FUTURE_COST_P07000862=       64193 rows
FUTURE_COST_P07000892=       61969 rows
FUTURE_COST_P07000907=       58880 rows
FUTURE_COST_P07000913=       60814 rows
FUTURE_COST_P07001155=       65123 rows
FUTURE_COST_P07020059=       64602 rows
FUTURE_COST_P07040008=       64741 rows
FUTURE_COST_P07040319=       64627 rows
FUTURE_COST_P07050002=       62215 rows
FUTURE_COST_P07052256=       59918 rows
FUTURE_COST_P07060227=       52744 rows
FUTURE_COST_P08010071=       62133 rows
FUTURE_COST_P08010271=       65134 rows
FUTURE_COST_P08010446=       65003 rows
FUTURE_COST_P08010526=       57254 rows
FUTURE_COST_P08010537=       62174 rows
FUTURE_COST_P08010572=       50114 rows
FUTURE_COST_P08010618=       58950 rows
FUTURE_COST_P08010668=       60455 rows
FUTURE_COST_P08010761=       62705 rows
FUTURE_COST_P08010851=       57179 rows
FUTURE_COST_P08011026=       64944 rows
FUTURE_COST_P08011482=       65176 rows
FUTURE_COST_P08011750=       64726 rows
FUTURE_COST_P08012937=       65193 rows
FUTURE_COST_P08013852=       61063 rows
FUTURE_COST_P08014207=       63311 rows
FUTURE_COST_P08014244=       59932 rows
FUTURE_COST_P08015351=       64698 rows
FUTURE_COST_P08016527=       55887 rows
FUTURE_COST_P08020129=       40263 rows
FUTURE_COST_P08020296=       63456 rows
FUTURE_COST_P08020576=       58806 rows
FUTURE_COST_P08021194=       63619 rows
FUTURE_COST_P08021760=       62182 rows
FUTURE_COST_P08025929=       52281 rows
FUTURE_COST_P08025984=       55777 rows
FUTURE_COST_P08030070=       64534 rows
FUTURE_COST_P08030156=       64445 rows
FUTURE_COST_P08030306=       65167 rows
FUTURE_COST_P08030448=       55137 rows
FUTURE_COST_P08030531=       61341 rows
FUTURE_COST_P08030680=       65008 rows
FUTURE_COST_P08030855=       60737 rows
FUTURE_COST_P08031104=       64367 rows
FUTURE_COST_P08031555=       62475 rows
FUTURE_COST_P08033798=       65138 rows
FUTURE_COST_P08035337=       61029 rows
FUTURE_COST_P08035939=       64044 rows
FUTURE_COST_P08036080=       64505 rows
FUTURE_COST_P08041427=       63619 rows
FUTURE_COST_P08070464=       64935 rows
FUTURE_COST_P08080019=       63670 rows
FUTURE_COST_P08080216=       62781 rows
FUTURE_COST_P08081215=       63886 rows
FUTURE_COST_P08082191=       62587 rows
FUTURE_COST_P08090225=       60575 rows
FUTURE_COST_P08091086=       53262 rows
FUTURE_COST_P08091137=       51837 rows
FUTURE_COST_P08091296=       60541 rows
FUTURE_COST_P08092025=       63903 rows
FUTURE_COST_P08130775=       65191 rows
FUTURE_COST_P08163636=       63718 rows
FUTURE_COST_P08303909=       64914 rows
FUTURE_COST_P08402745=       65152 rows
FUTURE_COST_P08560627=       65075 rows
FUTURE_COST_P08810334=       64526 rows
FUTURE_COST_P08813682=       65074 rows
FUTURE_COST_P08830290=       63878 rows
FUTURE_COST_P08930433=       65085 rows
FUTURE_COST_P08931117=       64156 rows
FUTURE_COST_P08931257=       64697 rows
FUTURE_COST_P08944072=       64951 rows
FUTURE_COST_P08950799=       65127 rows
FUTURE_COST_P08962502=       65053 rows
FUTURE_COST_P08963442=       64858 rows
FUTURE_COST_P08963937=       65053 rows
FUTURE_COST_P08972445=       64726 rows
FUTURE_COST_P08973754=       64752 rows
FUTURE_COST_P08974331=       65170 rows
FUTURE_COST_P08974836=       64784 rows
FUTURE_COST_P08980748=       65118 rows
FUTURE_COST_P09500006=       17731 rows
FUTURE_COST_P09500008=       61800 rows
FUTURE_COST_P09500009=       67714 rows
FUTURE_COST_P09500045=       38812 rows
FUTURE_COST_P09500048=       52504 rows
FUTURE_COST_P09500054=       64105 rows
FUTURE_COST_P09500085=       49173 rows
FUTURE_COST_P09500087=       43114 rows
FUTURE_COST_P09500110=       62426 rows
FUTURE_COST_P09500166=       64716 rows
FUTURE_COST_P09500308=       61433 rows
FUTURE_COST_P09500701=       61917 rows
FUTURE_COST_P09501106=       65187 rows
FUTURE_COST_P09510019=       59662 rows
FUTURE_COST_P09510056=       65176 rows
FUTURE_COST_P09510132=       64174 rows
FUTURE_COST_P09510191=       58493 rows
FUTURE_COST_P09510217=       60733 rows
FUTURE_COST_P09510254=       63075 rows
FUTURE_COST_P09510311=       64104 rows
FUTURE_COST_P09510391=       62980 rows
FUTURE_COST_P09510495=       65038 rows
FUTURE_COST_P09510644=       64900 rows
FUTURE_COST_P09510825=       64747 rows
FUTURE_COST_P09511024=       64933 rows
FUTURE_COST_P09511131=       65082 rows
FUTURE_COST_P09520132=       65043 rows
FUTURE_COST_P09520706=       60890 rows
FUTURE_COST_P09521524=       65172 rows
FUTURE_COST_P09521841=       65189 rows
FUTURE_COST_P09531213=       65133 rows
FUTURE_COST_P09610533=       65190 rows
FUTURE_COST_P09611875=       65189 rows
FUTURE_COST_P09614674=       64827 rows
FUTURE_COST_P90000302=       65179 rows
FUTURE_COST_P90001315=       65163 rows
FUTURE_COST_P90002284=       65120 rows
FUTURE_COST_P90003018=       65177 rows
FUTURE_COST_P90003719=       65171 rows
FUTURE_COST_P90004415=       65110 rows
FUTURE_COST_P90005376=       65154 rows
FUTURE_COST_P90006382=       65187 rows
FUTURE_COST_P90007232=       65113 rows
FUTURE_COST_P90008192=       65170 rows
FUTURE_COST_P90009104=       65178 rows
FUTURE_COST_P90009887=       65162 rows
FUTURE_COST_P90010901=       65155 rows
FUTURE_COST_P90012070=       65171 rows
FUTURE_COST_P90013579=       65016 rows
FUTURE_COST_P90014057=       64994 rows
FUTURE_COST_P90014645=       65030 rows
FUTURE_COST_P90015101=       65067 rows
FUTURE_COST_P90015573=       65092 rows
FUTURE_COST_P90015972=       65139 rows
FUTURE_COST_P90016729=       65125 rows
FUTURE_COST_P90017557=       65151 rows
FUTURE_COST_P90018375=       65131 rows
FUTURE_COST_P90019110=       65186 rows
FUTURE_COST_P90019676=       65162 rows
FUTURE_COST_P90020399=       65118 rows
FUTURE_COST_P90021301=       65099 rows
FUTURE_COST_P90022329=       65155 rows
FUTURE_COST_P90023271=       65159 rows
FUTURE_COST_P90024197=       65191 rows
FUTURE_COST_P90025106=       65176 rows
FUTURE_COST_P90026051=       65167 rows
FUTURE_COST_P90027006=       65178 rows
FUTURE_COST_P90027931=       65106 rows
FUTURE_COST_P90028884=       65130 rows
FUTURE_COST_P90029438=       64887 rows
FUTURE_COST_P90029636=       64703 rows
FUTURE_COST_P90029842=       64923 rows
FUTURE_COST_P90030111=       65072 rows
FUTURE_COST_P90030380=       65139 rows
FUTURE_COST_P90030706=       64371 rows
FUTURE_COST_P90030997=       64705 rows
FUTURE_COST_P90031244=       64697 rows
FUTURE_COST_P90031334=       56575 rows
FUTURE_COST_P90031435=       61131 rows
FUTURE_COST_P90031637=       64637 rows
FUTURE_COST_P90031923=       64605 rows
FUTURE_COST_P90032130=       64904 rows
FUTURE_COST_P90032305=       65153 rows
FUTURE_COST_P90032545=       63031 rows
FUTURE_COST_P90032826=       64319 rows
FUTURE_COST_P90033004=       65065 rows
FUTURE_COST_P90033041=       62631 rows
FUTURE_COST_P90033248=       65116 rows
FUTURE_COST_P90033466=       65149 rows
FUTURE_COST_P90033633=       63467 rows
FUTURE_COST_P90033798=       64197 rows
FUTURE_COST_P90033909=       61266 rows
FUTURE_COST_P90034020=       64950 rows
FUTURE_COST_P90034162=       65000 rows
FUTURE_COST_P90034307=       65164 rows
FUTURE_COST_P90034420=       63990 rows
FUTURE_COST_P90034556=       62302 rows
FUTURE_COST_P90034747=       65016 rows
FUTURE_COST_P90034903=       64932 rows
FUTURE_COST_P90035183=       65175 rows
FUTURE_COST_P90035338=       59668 rows
FUTURE_COST_P90035608=       63071 rows
FUTURE_COST_P90035849=       64452 rows
FUTURE_COST_P90036130=       65096 rows
FUTURE_COST_P90036268=       65013 rows
FUTURE_COST_P90036441=       64870 rows
FUTURE_COST_P90036531=       57974 rows
FUTURE_COST_P90036645=       64347 rows
FUTURE_COST_P90036795=       65169 rows
FUTURE_COST_P90036905=       65033 rows
FUTURE_COST_P90037169=       64879 rows
FUTURE_COST_P90037308=       65024 rows
FUTURE_COST_P90037413=       62474 rows
FUTURE_COST_P90037575=       65178 rows
FUTURE_COST_P90037734=       64983 rows
FUTURE_COST_P90037947=       65150 rows
FUTURE_COST_P90038175=       65030 rows
FUTURE_COST_P90038405=       65165 rows
FUTURE_COST_P90038513=       65169 rows
FUTURE_COST_P90038638=       58268 rows
FUTURE_COST_P90038762=       60795 rows
FUTURE_COST_P90038894=       64328 rows
FUTURE_COST_P90039005=       65133 rows
FUTURE_COST_P90039194=       62930 rows
FUTURE_COST_P90039375=       64857 rows
FUTURE_COST_P90039640=       60881 rows
FUTURE_COST_P90039741=       65048 rows
FUTURE_COST_P90039839=       63797 rows
FUTURE_COST_P90040000=       65155 rows
FUTURE_COST_P90040254=       64708 rows
FUTURE_COST_P90040462=       62908 rows
FUTURE_COST_P90040695=       63042 rows
FUTURE_COST_P90041040=       65005 rows
FUTURE_COST_P90041196=       65086 rows
FUTURE_COST_P90041272=       54789 rows
FUTURE_COST_P90041435=       65184 rows
FUTURE_COST_P90041569=       65187 rows
FUTURE_COST_P90041718=       62802 rows
FUTURE_COST_P90041937=       65143 rows
FUTURE_COST_P90042052=       65179 rows
FUTURE_COST_P90042150=       42480 rows
FUTURE_COST_P90042229=       65160 rows
FUTURE_COST_P90042337=       65032 rows
FUTURE_COST_P90042484=       65024 rows
FUTURE_COST_P90042763=       64335 rows
FUTURE_COST_P90043005=       65097 rows
FUTURE_COST_P90043328=       64570 rows
FUTURE_COST_P90043578=       63757 rows
FUTURE_COST_P90043823=       59399 rows
FUTURE_COST_P90044109=       65044 rows
FUTURE_COST_P90044211=       57364 rows
FUTURE_COST_P90044432=       65183 rows
FUTURE_COST_P90044703=       65158 rows
FUTURE_COST_P90044768=       63773 rows
FUTURE_COST_P90044933=       63845 rows
FUTURE_COST_P90045108=       63631 rows
FUTURE_COST_P90045180=       64911 rows
FUTURE_COST_P90045359=       64313 rows
FUTURE_COST_P90045555=       64899 rows
FUTURE_COST_P90045817=       64595 rows
FUTURE_COST_P90045938=       44096 rows
FUTURE_COST_P90046050=       64984 rows
FUTURE_COST_P90046232=       64743 rows
FUTURE_COST_P90046428=       65010 rows
FUTURE_COST_P90046586=       63893 rows
FUTURE_COST_P90046793=       65175 rows
FUTURE_COST_P90047012=       63718 rows
FUTURE_COST_P90047106=       60918 rows
FUTURE_COST_P90047212=       64545 rows
FUTURE_COST_P90047455=       65029 rows
FUTURE_COST_P90047689=       64763 rows
FUTURE_COST_P90047821=       63809 rows
FUTURE_COST_P90048087=       65191 rows
FUTURE_COST_P90048279=       65169 rows
FUTURE_COST_P90048448=       64828 rows
FUTURE_COST_P90048695=       64431 rows
FUTURE_COST_P90048904=       64765 rows
FUTURE_COST_P90049139=       64910 rows
FUTURE_COST_P90049437=       64999 rows
FUTURE_COST_P90049838=       65019 rows
FUTURE_COST_P90050095=       64257 rows
FUTURE_COST_P90050330=       64677 rows
FUTURE_COST_P90050595=       64979 rows
FUTURE_COST_P90050782=       63922 rows
FUTURE_COST_P90050940=       64061 rows
FUTURE_COST_P90051039=       62252 rows
FUTURE_COST_P90051193=       63839 rows
FUTURE_COST_P90051303=       64359 rows
FUTURE_COST_P90051518=       64979 rows
FUTURE_COST_P90051587=       65096 rows
FUTURE_COST_P90051881=       64669 rows
FUTURE_COST_P90052110=       63765 rows
FUTURE_COST_P90052192=       64508 rows
FUTURE_COST_P90052391=       65076 rows
FUTURE_COST_P90052687=       54453 rows
FUTURE_COST_P90052850=       64166 rows
FUTURE_COST_P90053086=       64193 rows
FUTURE_COST_P90053225=       61417 rows
FUTURE_COST_P90053341=       64948 rows
FUTURE_COST_P90053512=       61846 rows
FUTURE_COST_P90053772=       65146 rows
FUTURE_COST_P90054071=       65025 rows
FUTURE_COST_P90054347=       64670 rows
FUTURE_COST_P90054500=       44340 rows
FUTURE_COST_P90054621=       63420 rows
FUTURE_COST_P90054744=       58807 rows
FUTURE_COST_P90054864=       64794 rows
FUTURE_COST_P90055066=       64644 rows
FUTURE_COST_P90055231=       60335 rows
FUTURE_COST_P90055391=       65121 rows
FUTURE_COST_P90055547=       64903 rows
FUTURE_COST_P90055726=       65151 rows
FUTURE_COST_P90055840=       59646 rows
FUTURE_COST_P90055978=       64142 rows
FUTURE_COST_P90056129=       64716 rows
FUTURE_COST_P90056275=       63817 rows
FUTURE_COST_P90056489=       65144 rows
FUTURE_COST_P90056591=       63476 rows
FUTURE_COST_P90056808=       64290 rows
FUTURE_COST_P90056931=       64830 rows
FUTURE_COST_P90057179=       64915 rows
FUTURE_COST_P90057343=       65193 rows
FUTURE_COST_P90057530=       64912 rows
FUTURE_COST_P90057734=       64655 rows
FUTURE_COST_P90057874=       62624 rows
FUTURE_COST_P90057979=       63849 rows
FUTURE_COST_P90058114=       64998 rows
FUTURE_COST_P90058570=       64418 rows
FUTURE_COST_P90058643=       65143 rows
FUTURE_COST_P90058845=       60475 rows
FUTURE_COST_P90059074=       65138 rows
FUTURE_COST_P90059405=       61143 rows
FUTURE_COST_P90059578=       64718 rows
FUTURE_COST_P90059731=       65050 rows
FUTURE_COST_P90059992=       64799 rows
FUTURE_COST_P90060156=       64580 rows
FUTURE_COST_P90060592=       65111 rows
FUTURE_COST_P90060934=       63041 rows
FUTURE_COST_P90061122=       64809 rows
FUTURE_COST_P90061331=       63270 rows
FUTURE_COST_P90061673=       64778 rows
FUTURE_COST_P90061948=       63657 rows
FUTURE_COST_P90062299=       65028 rows
FUTURE_COST_P90062709=       65153 rows
FUTURE_COST_P90063038=       64642 rows
FUTURE_COST_P90063427=       65186 rows
FUTURE_COST_P90063546=       61576 rows
FUTURE_COST_P90063896=       63207 rows
FUTURE_COST_P90064035=       59309 rows
FUTURE_COST_P90064344=       65073 rows
FUTURE_COST_P90064780=       63156 rows
FUTURE_COST_P90065080=       63567 rows
FUTURE_COST_P90065562=       65168 rows
FUTURE_COST_P90066357=       65033 rows
FUTURE_COST_P90066642=       65173 rows
FUTURE_COST_P90067030=       65081 rows
FUTURE_COST_P90067413=       63908 rows
FUTURE_COST_P90067675=       63551 rows
FUTURE_COST_P90068175=       65044 rows
FUTURE_COST_P90068572=       65165 rows
FUTURE_COST_P90068893=       65185 rows
FUTURE_COST_P90069290=       64992 rows
FUTURE_COST_P90069780=       64697 rows
FUTURE_COST_P90070199=       64951 rows
FUTURE_COST_P90070644=       64910 rows
FUTURE_COST_P90071052=       64874 rows
FUTURE_COST_P90071572=       64726 rows
FUTURE_COST_P90072194=       63381 rows
FUTURE_COST_P999999990=           0 rows

PL/SQL procedure successfully completed.
Range by numbers in action:
SQL> exec tools.partition_tools.recs_in_partiton ('1,1','RMS','FUTURE_COST2');
FUTURE_COST_P01310100=       62688 rows

PL/SQL procedure successfully completed.
SQL> exec tools.partition_tools.recs_in_partiton ('1,2','RMS','FUTURE_COST2');
FUTURE_COST_P01310100=       62688 rows
FUTURE_COST_P01310147=       59039 rows

PL/SQL procedure successfully completed.
SQL> exec tools.partition_tools.recs_in_partiton ('2,2','RMS','FUTURE_COST2');
FUTURE_COST_P01310147=       59039 rows
FUTURE_COST_P01310472=       64983 rows

PL/SQL procedure successfully completed.
SQL> set serveroutput on size 1000000;
SQL> exec tools.partition_tools.recs_in_partiton ('10,10', 'RMS','FUTURE_COST2');
FUTURE_COST_P01400049=       65053 rows
FUTURE_COST_P01400081=       47488 rows
FUTURE_COST_P01400101=       65048 rows
FUTURE_COST_P01400318=       64828 rows
FUTURE_COST_P01400955=       58633 rows
FUTURE_COST_P01401572=       54898 rows
FUTURE_COST_P01401747=       61498 rows
FUTURE_COST_P01401776=       27070 rows
FUTURE_COST_P01401925=       60750 rows
FUTURE_COST_P01402186=       63320 rows

PL/SQL procedure successfully completed.
partition list in action:
SQL> SQL> exec tools.partition_tools.recs_in_partition ('FUTURE_COST_P90061948,FUTURE_COST_P90062299,FUTURE_COST_P90062709,FUTURE_COST_P90063038,FUTURE_COST_P90063427,FUTURE_COST_P90063546,FUTURE_COST_P90063896,FUTURE_COST_P9
0064035,FUTURE_COST_P90064344,FUTURE_COST_P90064780,FUTURE_COST_P90065080,FUTURE_COST_P90065562,FUTURE_COST_P90066357,FUTURE_COST_P90066642','RMS','FUTURE_COST2');

FUTURE_COST_P90061948=       63657 rows
FUTURE_COST_P90062299=       65028 rows
FUTURE_COST_P90062709=       65153 rows
FUTURE_COST_P90063038=       64642 rows
FUTURE_COST_P90063427=       65186 rows
FUTURE_COST_P90063546=       61576 rows
FUTURE_COST_P90063896=       63207 rows
FUTURE_COST_P90064035=       59309 rows
FUTURE_COST_P90064344=       65073 rows
FUTURE_COST_P90064780=       63156 rows
FUTURE_COST_P90065080=       63567 rows
FUTURE_COST_P90065562=       65168 rows
FUTURE_COST_P90066357=       65033 rows
FUTURE_COST_P90066642=       65173 rows

PL/SQL procedure successfully completed.

Function

Function has the used in situation when you do not need text output but numbers which you'll use for further calculations. For an example calculating average etc. Here are examples that would explain that:
col min_v for a15;
col max_v for a15;
col avg_v for 9999999990D90;
col med_v for 9999999990D90;  
col delta_v for 9999999990D90;
              
SELECT min(column_value) min_v, max(column_value) max_v, avg (cast (column_value as INTEGER)) avg_v, median (cast (column_value as INTEGER)) med_v, 
       ABS (avg (cast (column_value as INTEGER)) - median (cast (column_value as INTEGER))) delta_v
  FROM TABLE(tools.list2table(tools.partition_tools.recs_in_partition('10,100', 'RMS','FUTURE_COST2','Y')));

MIN_V           MAX_V                    AVG_V          MED_V        DELTA_V
--------------- --------------- -------------- -------------- --------------
27070           65181                 60582.02       63162.00        2579.98
Real use of this is when you need to create partition with equal width of records in each, then median value should not differe too much from average.

Hope this helps someone.

Cheers!

No comments :

Post a Comment

Zagreb u srcu!

Copyright © 2009-2018 Damir Vadas

All rights reserved.


Sign by Danasoft - Get Your Sign