Index for "group by" statement.

Hi,
I have a statement directed at the GLPCP table.
It sums op the plan number in each month.
In ABAP it looks like this
SELECT ryear rprctr racct kostl ps_psp_pnr rfarea
         SUM( hsl01 ) SUM( hsl02 ) SUM( hsl03 )
         SUM( hsl04 ) SUM( hsl05 ) SUM( hsl06 )
         SUM( hsl07 ) SUM( hsl08 ) SUM( hsl09 )
         SUM( hsl10 ) SUM( hsl11 ) SUM( hsl12 )
         INTO TABLE e_t_data
         FROM glpcp
         WHERE kokrs   EQ '0020'
         AND   ryear   IN l_r_year
         AND   rldnr   EQ '8A'
         AND   rrcty   EQ '1'
         AND   rvers   EQ '010'
         AND   rbukrs  EQ '0020'
         GROUP BY ryear rprctr racct kostl ps_psp_pnr rfarea.
I have created an index on KOKRS, RYEAR, RLDNR, RRCTY, RVERS, RBUKRS. To support the where statement.
This speeds up the process some but i believe that greater performance can be achieved.
I ran the expression through the SQL explain routine.
The path looks like this http://yfrog.com/jdexplainpathj
It came out with poor performance regarding the group by sentence.
Explanation of query block number: 1   step: 2
Query block type is SELECT
Performance appears to be bad
Method:
.          additional sorts needed
.          for the composite table (current result table)
.          the sorts are performed
.          - to meet an GROUP BY
.          unknown or no prefetch is used
How can i build an index to support the group by sentence.
Best Regards
- Rasmus

Hi Hermann,
I can see why you are confused. It is hard to keep track with the changes.
I will sum up:
The abap statement.
SELECT ryear rprctr racct kostl ps_psp_pnr
         SUM( hsl01 ) SUM( hsl02 ) SUM( hsl03 )
         SUM( hsl04 ) SUM( hsl05 ) SUM( hsl06 )
         SUM( hsl07 ) SUM( hsl08 ) SUM( hsl09 )
         SUM( hsl10 ) SUM( hsl11 ) SUM( hsl12 )
         INTO TABLE it_glpcp
         FROM glpcp
         WHERE kokrs   EQ '0020'
         AND   ryear   IN l_r_year
         AND   rldnr   EQ '8A'
         AND   rrcty   EQ '1'
         AND   rvers   EQ '010'
         AND   rbukrs  EQ '0020'
         GROUP BY rprctr racct kostl ps_psp_pnr ryear.
The SQL statement mad from the abap:
SELECT                                                                               
"RYEAR" , "RPRCTR" , "RACCT" , "KOSTL" , "PS_PSP_PNR" ,"RFAREA" , SUM( "HSL01" ) , SUM( "HSL02" ) ,   
  SUM( "HSL03" ) , SUM("HSL04" ) , SUM( "HSL05" ) , SUM( "HSL06" ) , SUM( "HSL07" ) , SUM("HSL08" ) ,   
  SUM( "HSL09" ) , SUM( "HSL10" ) , SUM( "HSL11" ) , SUM("HSL12" )                                      
FROM                                                                               
"GLPCP"                                                                               
WHERE                                                                               
"RCLNT" = ? AND "KOKRS" = ? AND "RYEAR" =? AND "RLDNR" = ? AND "RRCTY" = ? AND "RVERS" = ? AND "RBUKRS"
  = ?GROUP BY "RYEAR" , "RPRCTR" , "RACCT" , "KOSTL" , "PS_PSP_PNR" ,"RFAREA" FOR FETCH ONLY WITH UR
The index no. 9.
http://yfrog.com/jbidx9j
The hierarchial access path:
http://yfrog.com/1qexplainj
This is where I stand at the moment.
Best Regards,
Rasmus
Edited by: Rasmus Stokholm on Apr 7, 2010 1:13 PM

Similar Messages

  • Indexes for group by query on table with 5million records

    Hi,
    Here is my query which is taking ages to run :
         SELECT approved.budgetReferenceno
                   , approved.projects
                   , approved.allocations
                   , rptgen4
                         , financialyear
                   , cashclass
                   , SUM(nvl(approved.FullYear,0)) as FullYear
              FROM   approved
              JOIN   rpt_entity ON rpt_entity.level0 = approved.entity
              JOIN   cashclasses     ON accountcode    = approved.account
        where budgetreferenceno = refno    
        and
            entity in ( 
               (select Level0 from rpt_entity   where   
               (   entityparent in (select * from table(split(userid)))    or   rptgen5 in (select * from table(split(userid)))   )   ) 
         and
           ccs in (select level0 from rpt_ccs where rptgen4 in (select * from table(split(userid)))) or
           ccs in (select level0 from rpt_ccs where rptgen5 in (select * from table(split(userid)))) or
           ccs in (select level0 from rpt_ccs where rptgen6 in (select * from table(split(userid)))) or
           ccs in (select level0 from rpt_ccs where rptgen7 in (select * from table(split(userid))) ) or
           ccs in (select distinct(substr(column_value,2,length(column_value)-2)) from table(split_comma(userid)) )
              GROUP BY approved.budgetReferenceno
                   , approved.projects
                   , approved.allocations
                   , rptgen4
                         , financialyear
                   , cashclass
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 4074481161
    | Id  | Operation                                | Name            | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                         |                 | 31234 |  3660K|       | 86141   (1)| 00:17:14 |
    |   1 |  HASH GROUP BY                           |                 | 31234 |  3660K|    17M| 86141   (1)| 00:17:14 |
    |*  2 |   FILTER                                 |                 |       |       |       |            |          |
    |*  3 |    HASH JOIN                             |                 |   138K|    15M|       | 82427   (1)| 00:16:30 |
    |   4 |     TABLE ACCESS FULL                    | CASHCLASSES     |  2875 | 48875 |       |     5   (0)| 00:00:01 |
    |*  5 |     HASH JOIN                            |                 |   138K|    13M|       | 82420   (1)| 00:16:30 |
    PLAN_TABLE_OUTPUT
    |   6 |      TABLE ACCESS FULL                   | RPT_entity  |   725 | 10875 |       |    11   (0)| 00:00:01 |
    |*  7 |      HASH JOIN RIGHT SEMI                |                 |   138K|    11M|       | 82408   (1)| 00:16:29 |
    |   8 |       VIEW                               | VW_NSO_1        |    71 |   568 |       |    11   (0)| 00:00:01 |
    |*  9 |        FILTER                            |                 |       |       |       |            |          |
    |  10 |         TABLE ACCESS FULL                | RPT_entity  |   725 | 17400 |       |    11   (0)| 00:00:01 |
    |* 11 |         COLLECTION ITERATOR PICKLER FETCH| SPLIT           |       |       |       |            |          |
    |* 12 |         COLLECTION ITERATOR PICKLER FETCH| SPLIT           |       |       |       |            |          |
    |* 13 |       TABLE ACCESS FULL                  | approved        |  1170K|    89M|       | 82389   (1)| 00:16:29 |
    |  14 |    NESTED LOOPS                          |                 |     1 |    18 |       |    46   (0)| 00:00:01 |
    |  15 |     COLLECTION ITERATOR PICKLER FETCH    | SPLIT           |       |       |       |            |          |
    |* 16 |     INDEX RANGE SCAN                     | CC_INDEX1       |     1 |    16 |       |     1   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |  17 |    NESTED LOOPS                          |                 |     2 |    46 |       |    51   (2)| 00:00:01 |
    |* 18 |     INDEX FAST FULL SCAN                 | CC_INDEX2       |     1 |    21 |       |    46   (3)| 00:00:01 |
    |* 19 |     COLLECTION ITERATOR PICKLER FETCH    | SPLIT           |       |       |       |            |          |
    |  20 |    NESTED LOOPS                          |                 |     1 |    24 |       |    52   (0)| 00:00:01 |
    |  21 |     TABLE ACCESS BY INDEX ROWID          | RPT_ccs |     1 |    22 |       |    46   (0)| 00:00:01 |
    |* 22 |      INDEX SKIP SCAN                     | CC_INDEX1       |     1 |       |       |    45   (0)| 00:00:01 |
    |* 23 |     COLLECTION ITERATOR PICKLER FETCH    | SPLIT           |       |       |       |            |          |
    |  24 |    NESTED LOOPS                          |                 |     2 |    50 |       |    60   (0)| 00:00:01 |
    |  25 |     TABLE ACCESS BY INDEX ROWID          | RPT_ccs |     1 |    23 |       |    46   (0)| 00:00:01 |
    |* 26 |      INDEX SKIP SCAN                     | CC_INDEX1       |     1 |       |       |    45   (0)| 00:00:01 |
    |* 27 |     COLLECTION ITERATOR PICKLER FETCH    | SPLIT           |       |       |       |            |          |
    PLAN_TABLE_OUTPUT
    |* 28 |    COLLECTION ITERATOR PICKLER FETCH     | SPLIT_COMMA     |       |       |       |            |          |
    Predicate Information (identified by operation id):
       2 - filter( EXISTS (SELECT 0 FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE
                  "LEVEL0"=:B1 AND "RPTGEN4"=VALUE(KOKBF$)) OR  EXISTS (SELECT 0 FROM "RPT_ccs"
                  "RPT_ccs",TABLE() "KOKBF$" WHERE "RPTGEN5"=VALUE(KOKBF$) AND "LEVEL0"=:B2) OR  EXISTS (SELECT 0
                  FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE "RPTGEN6"=VALUE(KOKBF$) AND "LEVEL0"=:B3)
                  OR  EXISTS (SELECT 0 FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE
    PLAN_TABLE_OUTPUT
                  "RPTGEN7"=VALUE(KOKBF$) AND "LEVEL0"=:B4) OR  EXISTS (SELECT 0 FROM TABLE() "KOKBF$" WHERE
                  SUBSTR(VALUE(KOKBF$),2,LENGTH(VALUE(KOKBF$))-2)=:B5))
       3 - access("ACCOUNTCODE"="approved"."ACCOUNT")
       5 - access("RPT_entity"."LEVEL0"="approved"."entity")
       7 - access("approved"."entity"="LEVEL0")
       9 - filter( EXISTS (SELECT 0 FROM TABLE() "KOKBF$" WHERE VALUE(KOKBF$)=:B1) OR  EXISTS (SELECT 0 FROM
                  TABLE() "KOKBF$" WHERE VALUE(KOKBF$)=:B2))
      11 - filter(VALUE(KOKBF$)=:B1)
      12 - filter(VALUE(KOKBF$)=:B1)
      13 - filter("approved"."BUDGETREFERENCENO"='BASE')
      16 - access("RPTGEN4"=VALUE(KOKBF$) AND "LEVEL0"=:B1)
    PLAN_TABLE_OUTPUT
      18 - filter("LEVEL0"=:B1)
      19 - filter("RPTGEN5"=VALUE(KOKBF$))
      22 - access("LEVEL0"=:B1)
           filter("LEVEL0"=:B1)
      23 - filter("RPTGEN6"=VALUE(KOKBF$))
      26 - access("LEVEL0"=:B1)
           filter("LEVEL0"=:B1)
      27 - filter("RPTGEN7"=VALUE(KOKBF$))
      28 - filter(SUBSTR(VALUE(KOKBF$),2,LENGTH(VALUE(KOKBF$))-2)=:B1)
    64 rows selected.
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for IBM/AIX RISC System/6000: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - ProductionThe table has 28 columns none indexed the columns mentioned here have non unique values.
    The table approved has more than 10million records and the query is taking a huge time.
    The query first tries to restrict the search to only valid entities and cc (already indexed and working fine).
    The cardinality of allocations, projects is around 1000, entity is 3000, and cc is around 50,000, reference number = 2000, financialyear = 4
    Please suggest which index would be best to use on these columns given that there will no updations but frequent insertions.
    If nothing else works than I will need to change it to pre aggregated data for overnight run .
    Thanks,
    Neetesh
    Edited by: user13312817 on Nov 16, 2011 11:05 AM
    Edited by: user13312817 on Nov 16, 2011 11:36 AM
    Edited by: user13312817 on Nov 16, 2011 11:38 AM
    Edited by: user13312817 on Nov 16, 2011 12:02 PM

    Hello Adam,
    Tried this but still not much of a difference.
    create index test_index on approved (budgetreferenceno,projects,allocations,financialyear,entity,ccs,FullYear) compress 6;
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    Plan hash value: 2463060356
    | Id  | Operation                               | Name            | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT                        |                 | 25030 |  4644K|       | 70852   (1)| 00:14:11 |
    |   1 |  TABLE ACCESS BY INDEX ROWID            | FEGEN4          |     1 |    13 |       |     2   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN                     | INDEX1          |     1 |       |       |     1   (0)| 00:00:01 |
    |   3 |  TABLE ACCESS BY INDEX ROWID            | CASHCLASSES     |     1 |    17 |       |     2   (0)| 00:00:01 |
    |*  4 |   INDEX UNIQUE SCAN                     | CASHCLASSES_PK  |     1 |       |       |     1   (0)| 00:00:01 |
    |   5 |  HASH GROUP BY                          |                 | 25030 |  4644K|    21M| 70852   (1)| 00:14:11 |
    PLAN_TABLE_OUTPUT
    |   6 |   VIEW                                  |                 |   109K|    19M|       | 68578   (1)| 00:13:43 |
    |*  7 |    FILTER                               |                 |       |       |       |            |          |
    |*  8 |     HASH JOIN RIGHT SEMI                |                 |   484K|    99M|       | 68578   (1)| 00:13:43 |
    |   9 |      VIEW                               | VW_NSO_1        |    71 |  7242 |       |    11   (0)| 00:00:01 |
    |* 10 |       FILTER                            |                 |       |       |       |            |          |
    |  11 |        TABLE ACCESS FULL                | RPT_entity  |   725 | 17400 |       |    11   (0)| 00:00:01 |
    |* 12 |        COLLECTION ITERATOR PICKLER FETCH| SPLIT           |       |       |       |            |          |
    |* 13 |        COLLECTION ITERATOR PICKLER FETCH| SPLIT           |       |       |       |            |          |
    |* 14 |      TABLE ACCESS FULL                  | approved         |   982K|   106M|       | 68560   (1)| 00:13:43 |
    |  15 |     NESTED LOOPS                        |                 |     1 |    18 |       |    46   (0)| 00:00:01 |
    |  16 |      COLLECTION ITERATOR PICKLER FETCH  | SPLIT           |       |       |       |            |          |
    PLAN_TABLE_OUTPUT
    |* 17 |      INDEX RANGE SCAN                   | CC_INDEX1       |     1 |    16 |       |     1   (0)| 00:00:01 |
    |  18 |     NESTED LOOPS                        |                 |     2 |    46 |       |    51   (2)| 00:00:01 |
    |* 19 |      INDEX FAST FULL SCAN               | CC_INDEX2       |     1 |    21 |       |    46   (3)| 00:00:01 |
    |* 20 |      COLLECTION ITERATOR PICKLER FETCH  | SPLIT           |       |       |       |            |          |
    |  21 |     NESTED LOOPS                        |                 |     1 |    24 |       |    52   (0)| 00:00:01 |
    |  22 |      TABLE ACCESS BY INDEX ROWID        | RPT_ccs |     1 |    22 |       |    46   (0)| 00:00:01 |
    |* 23 |       INDEX SKIP SCAN                   | CC_INDEX1       |     1 |       |       |    45   (0)| 00:00:01 |
    |* 24 |      COLLECTION ITERATOR PICKLER FETCH  | SPLIT           |       |       |       |            |          |
    |  25 |     NESTED LOOPS                        |                 |     2 |    50 |       |    60   (0)| 00:00:01 |
    |  26 |      TABLE ACCESS BY INDEX ROWID        | RPT_ccs |     1 |    23 |       |    46   (0)| 00:00:01 |
    |* 27 |       INDEX SKIP SCAN                   | CC_INDEX1       |     1 |       |       |    45   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    |* 28 |      COLLECTION ITERATOR PICKLER FETCH  | SPLIT           |       |       |       |            |          |
    |* 29 |     COLLECTION ITERATOR PICKLER FETCH   | SPLIT_COMMA     |       |       |       |            |          |
    Predicate Information (identified by operation id):
       2 - access("LEVEL0"=:B1)
       4 - access("ACCOUNTCODE"=:B1)
       7 - filter( EXISTS (SELECT 0 FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE
                  "LEVEL0"=:B1 AND "RPTGEN4"=VALUE(KOKBF$)) OR  EXISTS (SELECT 0 FROM "RPT_ccs"
    PLAN_TABLE_OUTPUT
                  "RPT_ccs",TABLE() "KOKBF$" WHERE "RPTGEN5"=VALUE(KOKBF$) AND "LEVEL0"=:B2) OR  EXISTS (SELECT 0
                  FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE "RPTGEN6"=VALUE(KOKBF$) AND "LEVEL0"=:B3)
                  OR  EXISTS (SELECT 0 FROM "RPT_ccs" "RPT_ccs",TABLE() "KOKBF$" WHERE
                  "RPTGEN7"=VALUE(KOKBF$) AND "LEVEL0"=:B4) OR  EXISTS (SELECT 0 FROM TABLE() "KOKBF$" WHERE
                  SUBSTR(VALUE(KOKBF$),2,LENGTH(VALUE(KOKBF$))-2)=:B5))
       8 - access("entity"="LEVEL0")
      10 - filter( EXISTS (SELECT 0 FROM TABLE() "KOKBF$" WHERE VALUE(KOKBF$)=:B1) OR  EXISTS (SELECT 0 FROM
                  TABLE() "KOKBF$" WHERE VALUE(KOKBF$)=:B2))
      12 - filter(VALUE(KOKBF$)=:B1)
      13 - filter(VALUE(KOKBF$)=:B1)
      14 - filter("BUDGETREFERENCENO"='BASE')
    PLAN_TABLE_OUTPUT
      17 - access("RPTGEN4"=VALUE(KOKBF$) AND "LEVEL0"=:B1)
      19 - filter("LEVEL0"=:B1)
      20 - filter("RPTGEN5"=VALUE(KOKBF$))
      23 - access("LEVEL0"=:B1)
           filter("LEVEL0"=:B1)
      24 - filter("RPTGEN6"=VALUE(KOKBF$))
      27 - access("LEVEL0"=:B1)
           filter("LEVEL0"=:B1)
      28 - filter("RPTGEN7"=VALUE(KOKBF$))
      29 - filter(SUBSTR(VALUE(KOKBF$),2,LENGTH(VALUE(KOKBF$))-2)=:B1)
    PLAN_TABLE_OUTPUT
    Note
       - dynamic sampling used for this statement
    69 rows selected.Thanks,
    Neetesh
    Edited by: user13312817 on Nov 17, 2011 7:04 AM

  • Index for group by

    Oracle 10g:
    Does having index help when doing query by "group by"?
    For eg: select aa, count(*) from B group by aa

    ErickG wrote:
    Hello,
    as yo used count(*) a full table scan will be performed. If you use a col1 that was indexed,
    like col1 for a count, not group by, an index scan will be performed, but be carefull if there
    is no null in table col1, the amount will be incorrect.
    RegardsSo I didn't understand that null col will destroy the count. Also why wouldn't having index help when doing group by?

  • Xml clause for group by statement t-sql.

    Hello ,
    I have this data.
    create table #students
    id int identity(1,1) primary key,
    student_id int not null,
    [year] int not null,
    [subject] varchar(50) not null,
    [marks] int not null
    insert into #students
    student_id ,
    [year] ,
    [subject] ,
    [marks]
    values
    (101,2014,'Arts',300),(101,2014,'Science',100),(101,2014,'Maths',400),
    (101,2015,'Arts',200),(101,2015,'Science',300),(101,2015,'Maths',100),
    (102,2014,'Arts',100),(102,2014,'Science',200),(102,2014,'Maths',300),
    (102,2015,'Arts',400),(102,2015,'Science',400),(102,2015,'Maths',200)
    select * from #students
    but i want the output in below format - per student per year the subject and marks should be as xml. Here is sample output.
    student_id [year] subject_marks_xml------------------------------------------------------------
    101 2014 <submarks><submark><subject>Arts</subject><marks>300</marks></submark><submark><subject>Science</subject><marks>100</marks></submark><submark><subject>maths</subject><marks>400</marks></submark></submarks>
    101 2015 <submarks><submark><subject>Arts</subject><marks>200</marks></submark><submark><subject>Science</subject><marks>300</marks></submark><submark><subject>maths</subject><marks>100</marks></submark></submarks>
    102 2014 <submarks><submark><subject>Arts</subject><marks>100</marks></submark><submark><subject>Science</subject><marks>200</marks></submark><submark><subject>maths</subject><marks>300</marks></submark></submarks>
    102 2015 <submarks><submark><subject>Arts</subject><marks>400</marks></submark><submark><subject>Science</subject><marks>400</marks></submark><submark><subject>maths</subject><marks>200</marks></submark></submarks>
    How can bring that up using xquery  ? thanks in advance for any help.

    you can use this
    SELECT student_id,
    [year],
    (SELECT subject,marks
    FROM #students
    WHERE student_id = t.student_id
    AND year = t.year
    FOR XML PATH('submark'),ROOT('submarks'),TYPE)
    FROM (SELECT DISTINCT student_id,
    [year]
    FROM #students)t
    Also see
    http://visakhm.blogspot.in/2013/12/generating-nested-xml-structures-with.html
    http://visakhm.blogspot.in/2014/05/t-sql-tips-fun-with-for-xml-path.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Errors in the OLAP storage engine: An error occurred while processing the indexes for the partition of the measure group of the cube from the database.

    Errors in the OLAP storage engine: An error occurred while processing the indexes for the partition of the measure group of the cube from the database.
    I have dropped and recreated a fact table to refresh the data as the table is having identity columns. So not able to directly insert data. After that cube is throwing above error.
    Please suggest.

    Hi Md,
    It hard to analyse the issue base on the limited information, Are there any error message on the log? Under C:\Program Files\Microsoft SQL Server\MSAS11.\OLAP\Log (this could be different for your server), there are 3 log files that are generated:
    msmdrrv.log
    FlightRecorderCurrent.trc
    FightRecorderBack.trc
    The msmdrrv.log simply points to the other two logs. There might be some detail information for this error. Please provide us the detail information about it, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • Proper using of index for parallel statement execution

    Hi all,
    I've created index for my table
    CREATE INDEX ZOO.rep184_med_arcdate ON ZOO.rep184_mediate(arcdate);It was before I started to think about parallel statement execution. As far as I've heard I should alter my index for proper using with parallel hint. Could you please suggest the way to go?

    marco wrote:
    Hi all,
    I've created index for my table
    CREATE INDEX ZOO.rep184_med_arcdate ON ZOO.rep184_mediate(arcdate);It was before I started to think about parallel statement execution. As far as I've heard I should alter my index for proper using with parallel hint. Could you please suggest the way to go?when all else fails Read The Fine Manual
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17118/sql_elements006.htm#autoId63

  • Why is the Star Transformation using two indexes for the same dimension?

    Hi,
    Recently, I have made an investigation about the Star Transformation feature. I have found a strange test case, which plays an important role in my strategy for our overall DWH architecture. Here it is:
    The Strategy:
    I would like to have the classical Star Transformation approach (single column Bitmap Indexes for each dimension foreign key column in the fact table), together with additional Bitmap Join Indexes for some of the dimension attributes, which would benefit from the materialization of the join (bitmap merge operation will be skipped/optimized).
    The query:
    select dp.brand, ds. region_name, dc.region_name
         , count(*), sum(f.extended_price)
      from fact_line_item  f
         , dim_part       dp
         , dim_supplier   ds
         , dim_customer   dc
    where dp.mfgr        = 10                 -- dimension selectivity = 1/10 --> acttual/fact selectivity = 6/10
       and f.part_dk      = dp.dk
       and ds.region_name = 'REGION #1' -- dimension selectivity = 1/9
       and f.supplier_dk  = ds.dk
       and dc.region_name = 'REGION #1' -- dimension selectivity = 1/11
       and f.customer_dk  = dc.dk
    group by dp.brand, ds. region_name, dc.region_name
    The actual plan:
    | Id  | Operation                              | Name                        | Starts | E-Rows | Cost (%CPU)| A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT                       |                             |      1 |        |  3247 (100)|      1 |00:01:42.05 |     264K|    220K|
    |   1 |  HASH GROUP BY                         |                             |      1 |      2 |  3247   (1)|      1 |00:01:42.05 |     264K|    220K|
    |*  2 |   HASH JOIN                            |                             |      1 |  33242 |  3037   (1)|    217K|00:01:29.67 |     264K|    220K|
    |*  3 |    TABLE ACCESS FULL                   | DIM_SUPPLIER                |      1 |   1112 |   102   (0)|   1112 |00:00:00.01 |     316 |      4 |
    |*  4 |    HASH JOIN                           |                             |      1 |  33245 |  2934   (1)|    217K|00:01:29.10 |     264K|    220K|
    |*  5 |     TABLE ACCESS FULL                  | DIM_CUSTOMER                |      1 |    910 |   102   (0)|    910 |00:00:00.08 |     316 |      8 |
    |*  6 |     HASH JOIN                          |                             |      1 |  33248 |  2831   (1)|    217K|00:01:28.57 |     264K|    220K|
    |*  7 |      TABLE ACCESS FULL                 | DIM_PART                    |      1 |     10 |     3   (0)|     10 |00:00:00.01 |       6 |      0 |
    |   8 |      PARTITION RANGE ALL               |                             |      1 |  36211 |  2827   (1)|    217K|00:01:28.01 |     264K|    220K|
    |   9 |       TABLE ACCESS BY LOCAL INDEX ROWID| FACT_LINE_ITEM              |      6 |  36211 |  2827   (1)|    217K|00:01:33.85 |     264K|    220K|
    |  10 |        BITMAP CONVERSION TO ROWIDS     |                             |      6 |        |            |    217K|00:00:07.09 |   46980 |   3292 |
    |  11 |         BITMAP AND                     |                             |      6 |        |            |     69 |00:00:08.33 |   46980 |   3292 |
    |  12 |          BITMAP MERGE                  |                             |      6 |        |            |    193 |00:00:02.09 |    2408 |   1795 |
    |  13 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   4330 |00:00:04.66 |    2408 |   1795 |
    |  14 |            BUFFER SORT                 |                             |      6 |        |            |     60 |00:00:00.01 |       6 |      0 |
    |* 15 |             TABLE ACCESS FULL          | DIM_PART                    |      1 |     10 |     3   (0)|     10 |00:00:00.01 |       6 |      0 |
    |* 16 |            BITMAP INDEX RANGE SCAN     | FACT_LI__P_PART_DIM_KEY_BIX |     60 |        |            |   4330 |00:00:02.11 |    2402 |   1795 |
    |* 17 |          BITMAP INDEX SINGLE VALUE     | FACT_LI__P_PART_MFGR_BJX    |      6 |        |            |   1747 |00:00:06.65 |     890 |    888 |
    |  18 |          BITMAP MERGE                  |                             |      6 |        |            |    169 |00:00:02.78 |   16695 |    237 |
    |  19 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   5460 |00:00:01.56 |   16695 |    237 |
    |  20 |            BUFFER SORT                 |                             |      6 |        |            |   5460 |00:00:00.02 |     316 |      0 |
    |* 21 |             TABLE ACCESS FULL          | DIM_CUSTOMER                |      1 |    910 |   102   (0)|    910 |00:00:00.01 |     316 |      0 |
    |* 22 |            BITMAP INDEX RANGE SCAN     | FACT_LI__P_CUST_DIM_KEY_BIX |   5460 |        |            |   5460 |00:00:02.07 |   16379 |    237 |
    |  23 |          BITMAP MERGE                  |                             |      6 |        |            |    170 |00:00:03.65 |   26987 |    372 |
    |  24 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   6672 |00:00:02.23 |   26987 |    372 |
    |  25 |            BUFFER SORT                 |                             |      6 |        |            |   6672 |00:00:00.01 |     316 |      0 |
    |* 26 |             TABLE ACCESS FULL          | DIM_SUPPLIER                |      1 |   1112 |   102   (0)|   1112 |00:00:00.01 |     316 |      0 |
    |* 27 |            BITMAP INDEX RANGE SCAN     | FACT_LI__S_SUPP_DIM_KEY_BIX |   6672 |        |            |   6672 |00:00:02.74 |   26671 |    372 |
    The Question:
    Why is the Star Transformation using both indexes FACT_LI__P_PART_DIM_KEY_BIX and FACT_LI__P_PART_MFGR_BJX for the same dimension criteria (dp.mfgr = 10)?? The introduction of the additional Bitmap Join Index actually make Oracle to do the work twice !!!
    Anybody, any idea ?!?

    Dom, here it is the plan with the predicates:
    | Id  | Operation                              | Name                        | Starts | E-Rows | Cost (%CPU)| A-Rows |   A-Time   | Buffers | Reads  |
    |   0 | SELECT STATEMENT                       |                             |      1 |        |  3638 (100)|      1 |00:06:41.17 |     445K|    236K|
    |   1 |  HASH GROUP BY                         |                             |      1 |      2 |  3638   (1)|      1 |00:06:41.17 |     445K|    236K|
    |*  2 |   HASH JOIN                            |                             |      1 |  33242 |  3429   (1)|    217K|00:08:18.02 |     445K|    236K|
    |*  3 |    TABLE ACCESS FULL                   | DIM_SUPPLIER                |      1 |   1112 |   102   (0)|   1112 |00:00:00.03 |     319 |    313 |
    |*  4 |    HASH JOIN                           |                             |      1 |  33245 |  3326   (1)|    217K|00:08:17.47 |     445K|    236K|
    |*  5 |     TABLE ACCESS FULL                  | DIM_CUSTOMER                |      1 |    910 |   102   (0)|    910 |00:00:00.01 |     319 |    313 |
    |*  6 |     HASH JOIN                          |                             |      1 |  33248 |  3223   (1)|    217K|00:08:16.63 |     445K|    236K|
    |*  7 |      TABLE ACCESS FULL                 | DIM_PART                    |      1 |     10 |     3   (0)|     10 |00:00:00.01 |       6 |      0 |
    |   8 |      PARTITION RANGE ALL               |                             |      1 |  36211 |  3219   (1)|    217K|00:08:16.30 |     445K|    236K|
    |   9 |       TABLE ACCESS BY LOCAL INDEX ROWID| FACT_LINE_ITEM              |      6 |  36211 |  3219   (1)|    217K|00:08:40.89 |     445K|    236K|
    |  10 |        BITMAP CONVERSION TO ROWIDS     |                             |      6 |        |            |    217K|00:00:32.00 |   46919 |  19331 |
    |  11 |         BITMAP AND                     |                             |      6 |        |            |     69 |00:00:34.50 |   46919 |  19331 |
    |  12 |          BITMAP MERGE                  |                             |      6 |        |            |    193 |00:00:00.58 |    2353 |      1 |
    |  13 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   4330 |00:00:00.10 |    2353 |      1 |
    |  14 |            BUFFER SORT                 |                             |      6 |        |            |     60 |00:00:00.01 |       6 |      0 |
    |* 15 |             TABLE ACCESS FULL          | DIM_PART                    |      1 |     10 |     3   (0)|     10 |00:00:00.01 |       6 |      0 |
    |* 16 |            BITMAP INDEX RANGE SCAN     | FACT_LI__P_PART_DIM_KEY_BIX |     60 |        |            |   4330 |00:00:00.07 |    2347 |      1 |
    |* 17 |          BITMAP INDEX SINGLE VALUE     | FACT_LI__P_PART_MFGR_BJX    |      6 |        |            |   1747 |00:01:23.64 |     882 |    565 |
    |  18 |          BITMAP MERGE                  |                             |      6 |        |            |    169 |00:00:09.14 |   16697 |   7628 |
    |  19 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   5460 |00:00:02.19 |   16697 |   7628 |
    |  20 |            BUFFER SORT                 |                             |      6 |        |            |   5460 |00:00:00.01 |     316 |      0 |
    |* 21 |             TABLE ACCESS FULL          | DIM_CUSTOMER                |      1 |    910 |   102   (0)|    910 |00:00:00.01 |     316 |      0 |
    |* 22 |            BITMAP INDEX RANGE SCAN     | FACT_LI__P_CUST_DIM_KEY_BIX |   5460 |        |            |   5460 |00:00:08.78 |   16381 |   7628 |
    |  23 |          BITMAP MERGE                  |                             |      6 |        |            |    170 |00:00:21.46 |   26987 |  11137 |
    |  24 |           BITMAP KEY ITERATION         |                             |      6 |        |            |   6672 |00:00:10.29 |   26987 |  11137 |
    |  25 |            BUFFER SORT                 |                             |      6 |        |            |   6672 |00:00:00.01 |     316 |      0 |
    |* 26 |             TABLE ACCESS FULL          | DIM_SUPPLIER                |      1 |   1112 |   102   (0)|   1112 |00:00:00.01 |     316 |      0 |
    |* 27 |            BITMAP INDEX RANGE SCAN     | FACT_LI__S_SUPP_DIM_KEY_BIX |   6672 |        |            |   6672 |00:00:20.94 |   26671 |  11137 |
    Predicate Information (identified by operation id):                                                                                                  
       2 - access("F"."SUPPLIER_DK"="DS"."DK")                                                                                                           
       3 - filter("DS"."REGION_NAME"='REGION #1')                                                                                                        
       4 - access("F"."CUSTOMER_DK"="DC"."DK")                                                                                                           
       5 - filter("DC"."REGION_NAME"='REGION #1')                                                                                                        
       6 - access("F"."PART_DK"="DP"."DK")                                                                                                               
       7 - filter("DP"."MFGR"=10)                                                                                                                        
      15 - filter("DP"."MFGR"=10)                                                                                                                        
      16 - access("F"."PART_DK"="DP"."DK")                                                                                                               
      17 - access("F"."SYS_NC00017$"=10)                                                                                                                 
      21 - filter("DC"."REGION_NAME"='REGION #1')                                                                                                        
      22 - access("F"."CUSTOMER_DK"="DC"."DK")                                                                                                           
      26 - filter("DS"."REGION_NAME"='REGION #1')                                                                                                        
      27 - access("F"."SUPPLIER_DK"="DS"."DK")                                                                                                           
    Note                                                                                                                                                 
       - star transformation used for this statement                                                                                                     

  • Bitmap indexes and group by

    I'm trying to understand why Oracle 8.1.6 sometimes uses bitmap indexes sometimes not.
    Of course I have all the statistics, my bitmap indexes are valid and so on.
    The problem is this:
    - I have a customer table very very large
    - I have many columns with bitmap indexes
    - I run this statement:
    select education_key, count(*)
    from customer
    group by education_key
    and obtain a correct execution plan:
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=235 Card=5 Bytes=10)
    1 0 SORT (GROUP BY NOSORT) (Cost=235 Card=5 Bytes=10)
    2 1 BITMAP CONVERSION (COUNT)
    3 2 BITMAP INDEX (FULL SCAN) OF 'CL_EDU'
    with the use of the bitmap indexes (only five different values)
    - now I want to put a condition on a column
    which has a bitmap index.
    The new statement is:
    select education_key, count(*)
    from customer
    where age_key = 30
    group by education_key
    No join, only a scan of a sort of
    fact table. In this case Oracle
    doesn't use the bitmap index on
    education_key:
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=3458 Card=5 Bytes=20
    1 0 SORT (GROUP BY) (Cost=3458 Card=5 Bytes=20)
    2 1 TABLE ACCESS (BY INDEX ROWID) OF 'CUSTOMER' (Cost=3395 C
    ard=18296 Bytes=73184)
    3 2 BITMAP CONVERSION (TO ROWIDS)
    4 3 BITMAP INDEX (SINGLE VALUE) OF 'CL_AGE'
    With this execution plan Oracle has to
    read some blocks from the table when I
    think that using both the bitmap indexes
    the query is faster.
    Someone knows why Oracle has this
    behaviour? I'm trying to change
    many things (also altering statistics
    value), but it seems that with a
    condition Oracle doesn'use the bitmap
    index on the group by column.
    null

    Hi Michael, what is the address for the lasagne? ....
    In init.ora.parms I had 32Mb for bitmap index merge, I suppose it's enough, hovewer I have tried to increase it and nothing changes.
    I already use STAR_TRASFORMATION_ENABLED=TRUE.
    I have tried with different level of statistics (estimate, compute, also with very precise histograms), always the same
    behaviour. I have also tried to change, in a manual way, the statistics in order to change the Oracle behaviour but nothing ...
    For this particular statement even if I use the INDEX_COMBINE hint, I mantain the same execution plan.
    I use CHOOSE, FIRST_ROWS, ALL_ROWS: always the same behaviour.
    I think that Oracle is not able to use a bitmap index on a column involved in a group by when there is another condition in the select.
    Hovewer with bitmap indexes, I have many other problems (to read 1% of the table Oracle decides to make a full table scan even if there are the correct bitmap indexes ...).
    Many of them are solved using BITMAP_INDEX, but it's difficult to use it in a query tool like Discover or Business Objects because I have to fix the use of INDEX_COMBINE also in situation in which this use is not correct from a performance point of view.
    The life with the query optimizer is very hard!
    Thank you for your guesses

  • Exchange Server 2013 Content Index is in "Unknown" state.

    Hi Experts,
    We have two Exchange Server 2013 CU3 installed in our customer premises 6 months back on top of Windows Server 2012 OS.
    From last week, we are getting the content index status as "Unknown" while checking the "Get-Mailboxdatabasecopystatus".
    We have tried to reseed the database by using "update-mailboxdatabasecopy -identity <db> -deleteexistingfiles then we came to know the server is not responding on port 3863.
    Attached image is for your reference.
    Need support from experts to resolve at the earliest.
    Regards,
    Santhosh
    Santhosh Sivaraman MCITP: Microsoft Exchange Server 2007/2010 | MCSE/MCSA

    Hi,
    I had the same issue and was able to solved by recreate the search index component on the mailbox servers
    Recreate the Search Foundation from scratch
    Stop and disable the search services and rename the Data Folder  "C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\HostController\Data"
    Open power shell and navigate to C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Installer
    Run the command :  .\installconfig.ps1 -action I -dataFolder "c:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\HostController\Data"
    Output should be like
    [PS] C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\Installer>.\installconfig.ps1 -action I -dataFolder "C:\Program Files\Microsoft\Exchange Server\V15\Bin\Search\Ceres\HostController\Data"
    Configuring Search Foundation for Exchange....
    Successfully configured Search Foundation for Exchange
    Rename the Index files for the database that are active on the node .
    Start the Search Services
    Removed a configuration entry that refers to the ContentSubmitters group. This entry is present in four XML files. Each file is called WcfConfigurator.
    you can find each file in the following folder:
    %ExchangeInstallPath%\Bin\Search\Ceres\HostController\Data\Nodes\Fsis\NODENAME\Configuration\Local
    Here, “%ExchangeInstallPath%” is the Exchange installation root path, and the placeholder NODENAME represents one of the following names. (There is one name for each of the four files that are to be edited.)
    AdminNode1
    ContentEngineNode1
    IndexNode1
    InteractionEngineNode1
    These are text files. You can use Notepad or any other convenient plain text editor to change them. Make sure that you make only the change that is described here.
    Each file contains at most one line that contains the following: <AuthorizedRole>ContentSubmitters</AuthorizedRole>
    Remove this line, and then save the file. Repeat this operation for each of the four files, and then restart the Microsoft Exchange Search Host Controller service.
    Found the Index files in Crawling state as expected instead of Unknown.
    Once all the Active copies are healthy and still the copies in failed and suspended state, then you can reseed the catalog files only using the below command
    Update-MailboxDatabaseCopy -Identity BD\MBserver –CatalogOnly
    Good Luck..
    Regards,
    Ayman Saleh

  • [svn] 4283: PARB Review changes for Group and DataGroup.

    Revision: 4283
    Author: [email protected]
    Date: 2008-12-10 14:34:18 -0800 (Wed, 10 Dec 2008)
    Log Message:
    PARB Review changes for Group and DataGroup. The main API changes are:
    - content property on Group and FxContainer renamed to mxmlContent.
    - contentFactory property on FxContainer renamed to mxmlContentFactory
    - New names for DataGroup methods: getRendererForItemAt(index:int):IVisualElement and getItemIndexForRenderer(renderer:IVisualElement):int. These are now in the mxml_internal namespace (not public anymore)
    - registerRenderer and unregisterRenderer are private methods (not public)
    Also, I made a minor fix to ITransformable.
    QE Notes: Steve's changing the mustella tests for me and will be checking in shortly.
    Doc Notes: None
    Bugs: SDK-18042
    Reviewer: Hans
    tests: checkintests, Steve ran mustella tests for all of gumbo and states
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-18042
    Modified Paths:
    flex/sdk/trunk/development/eclipse/flex/flex4test/src/skins/CircularScrollBarSkin.mxml
    flex/sdk/trunk/development/eclipse/flex/flex4test/src/skins/CircularScrollBarTrackSkin.mx ml
    flex/sdk/trunk/development/eclipse/flex/flex4test/src/skins/MyScrollBarTrackSkin.mxml
    flex/sdk/trunk/development/eclipse/flex/flex4test/src/skins/MyVScrollBarSkin.mxml
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/DataGroup.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxButtonBar.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxContainer.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/FxList.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/Group.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/FxListBase.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/components/baseClasses/GroupBase.as
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/graphicsClasses/GraphicElement.a s
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxDefaultComplexItemRenderer. mxml
    flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/ITransformable.as
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxDefaultComplexItemRenderer.m xml
    flex/sdk/trunk/frameworks/projects/wireframe/src/wireframe/FxDefaultItemRenderer.mxml

    Dear friend,
    Check table: V_503_ALL 
    V_T512Z and V_511_B are the tables for assigment of Permissibility based on ESG and PSA
    After creating new EG/ESG (grouping also).
    Please note that when we update Employee Group/Subgroup of position in PP01, it is not effective to PF in master data which was maintained with that position & old Employee group/supgroup.
    So you should check:
    - Position
    - PFs with old EG/ESG.
    Regards
    Edited by: tungph on Oct 19, 2011 11:14 AM
    Edited by: tungph on Oct 19, 2011 11:17 AM

  • What is the condition for First write statement in reports?

    What is the condition for First write statement in reports?

    In
    TOP-OF-PAGE & START-OF-SELECTION.
    U have to write what ever u want to dispaly.
    Top-of-page will trigger first and write the statements.
    SAmple report program for reference.
    REPORT ztemplate
              NO STANDARD PAGE HEADING
              LINE-SIZE 130
              LINE-COUNT 65
              MESSAGE-ID zm.
    * The Data Declarations
    TABLES:    mara." General Material Data.
    * Type Declarations:
    TYPES : BEGIN OF ty_mara,
              cb(1),
              matnr LIKE mara-matnr,
              mtart LIKE mara-mtart,
              matkl LIKE mara-matkl,
             END OF ty_mara.
    * Internal Tables:
    * The following structure type must be defined in the data dictionary
    DATA :  i_output TYPE ty_mara OCCURS 0 WITH HEADER LINE.
    DATA: lines TYPE i, free TYPE i.
    * The Selection Screen Definition
    SELECTION-SCREEN BEGIN OF BLOCK b_main WITH FRAME TITLE text-b01.
    *SELECTION-SCREEN skip.
    SELECT-OPTIONS: s_matnr FOR  mara-matnr.                  "Material No
    *PARAMETERS:     P_XXXXX like XXXX-XXXXX.                   "Description
    *PARAMETERS:     CB_XXXX as checkbox.                       "Description
    *PARAMETERS:     RB_XXXY radiobutton group XXX default 'X'. "Description
    *PARAMETERS:     RB_XXXZ radiobutton group XXX.             "Description
    *SELECTION-SCREEN COMMENT fmt name.
    SELECTION-SCREEN END OF BLOCK b_main.
    *SELECTION-SCREEN ULINE.
    *eject
    * INITIALIZATION
    INITIALIZATION.
    * AT SELECTION-SCREEN
    AT SELECTION-SCREEN.
    *Validate material no details
    IF NOT s_matnr[] IS INITIAL.
    LOOP AT s_matnr.
    IF NOT s_matnr-low  IS INITIAL.
      SELECT SINGLE matnr INTO v_matnr
             FROM mara
             WHERE matnr = s_matnr-low.
      IF sy-subrc NE 0.
        MESSAGE i128.
        LEAVE LIST-PROCESSING.
      ENDIF.
      ENDIF.
    IF NOT s_matnr-high IS INITIAL.
      SELECT SINGLE matnr INTO v_matnr
             FROM mara
             WHERE matnr = s_matnr-high.
      IF sy-subrc NE 0.
        MESSAGE i128.
        LEAVE LIST-PROCESSING.
      ENDIF.
      ENDIF.
    ENDLOOP.
    ENDIF.
    * START-OF-SELECTION
    START-OF-SELECTION.
       REFRESH: i_output.
      CLEAR  : i_output.
      SELECT matnr
             mtart
             matkl
             INTO TABLE i_output
             FROM mara
             WHERE mara~matnr IN s_matnr.
      IF sy-subrc NE 0.
        MESSAGE i000 WITH text-002.
        " No records found for selected criteria
            leave list-processing.
      ENDIF.
      IF NOT i_output[] IS INITIAL.
        LOOP AT i_output INTO wa_output.
          WRITE:/001 wa_output-cb AS checkbox,
                 003 wa_output-matnr,
                 015 wa_output-mtart,
                 024 wa_output-matkl.
          CLEAR wa_output.
        ENDLOOP.
      ENDIF.
    * END-OF-SELECTION
    END-OF-SELECTION.
      lines = sy-linno - 1.
    SET PF-STATUS 'ZSTATUS'.
    AT USER-COMMAND.
          wa_output-cb = space.
          SET PF-STATUS 'ZSTATUS' EXCLUDING 'SAVE'.
          DO lines TIMES.
            READ LINE sy-index FIELD VALUE wa_output-cb.
              IF wa_output-cb = 'X'.
            MODIFY i_output  FROM wa_output INDEX sy-tabix TRANSPORTING cb.
            ENDIF.
          ENDDO.
    CASE sy-ucomm.
    WHEN 'SAVE'.
          DELETE i_output WHERE cb = 'X'.
    WHEN 'BACK'.
    LEAVE SCREEN.
    ENDCASE.
    * TOP-OF-PAGE.
    TOP-OF-PAGE.
      ULINE.
      FORMAT INTENSIFIED OFF.
      FORMAT COLOR COL_HEADING.
      WRITE:/001 'CB' ,
             003 'Material No',
             015 'Mat type',
             024 'Mat group'.
      FORMAT COLOR OFF.
      FORMAT INTENSIFIED ON.
      ULINE.

  • Index File group on same drive as data files

    I've just found a file group used for indexes on the same drive as the data files.
    Am i correct in saying there is little benefit to this. The index file group should be on it's own spindle?
    Mr Shaw... One day I might know a thing or two about SQL Server!

    Definitely there will be performance gain provided you are querying for related data which as references index on those index filegroups.
    It helps in parallel processing , having data and index on multiple disk heads helps in reading the data parallel. For more information you can refer the below link
    https://technet.microsoft.com/en-us/library/ms190433%28v=sql.105%29.aspx
    --Prashanth

  • Creation of secondary indexes for table "RSBATCHCTRL_PAR" failed

    Hi ,
    We have installed EHP1 on our BI7.0 system successfully, later we are trying to apply SPS01 for this EHP but we got the follwoing error during TBATG conversion.
    2 EGT092 Conversion of table "RSBATCHCTRL_PAR" was restarted
    2 EGT241 The conversion is continued at step "6"
    2 EGT246 Type of conversion: "T" -> "T"
    2 EGT240XBegin step "RSBATCHCTRL_PAR-STEP6":
    4 EGT281 sql:
    4 ED0314 CREATE
    4 ED0314 INDEX [RSBATCHCTRL_PAR~DB] ON [RSBATCHCTRL_PAR]
    4 ED0314 ( [JOBNAME] ,
    4 ED0314 [JOBCOUNT] ,
    4 ED0314 [SERVER] ,
    4 ED0314 [HOST] ,
    4 ED0314 [WP_NO] ,
    4 ED0314 [WP_PID] ,
    4 ED0314 [PROCESS_TYPE] )
    4 ED0314 WITH ( ONLINE=OFF )
    4 ED0314 ON [PRIMARY]
    2 ED0314 Line 1: Incorrect syntax near '('.
    3 EDA093 "DDL time(___1):" ".........6" milliseconds
    2EEGT236 The SQL statement was not executed
    2EEDI006 Index " " could not be created completely in the database
    2EEGT221 Creation of secondary indexes for table "RSBATCHCTRL_PAR" failed
    2EEGT239 Error in step "RSBATCHCTRL_PAR-STEP6"
    2 EGT253XTotal time for table "RSBATCHCTRL_PAR": "000:00:00"
    2EEGT094 Conversion could not be restarted
    2 EGT067 Request for "RSBATCHCTRL_PAR" could not be executed
    1 ED0327XProcess..................: "ferrari_12"
    1 ED0302X=========================================================================
    1 ED0314 DD: Execution of Database Operations
    1 ED0302 =========================================================================
    1 ED0327 Process..................: "ferrari_12"
    1 ED0319 Return code..............: "0"
    1 ED0314 Phase 001................: < 1 sec. (Preprocessing of TBATG)
    1 ED0314 Phase 002................: < 1 sec. (Partitioning)
    1 ED0309 Program runtime..........: "< 1 sec."
    1 ED0305 Date, time...............: "03.06.2009", "12:47:21"
    1 ED0318 Program end==============================================================
    1 ETP166 CONVERSION OF DD OBJECTS (TBATG)
    1 ETP110 end date and time   : "20090603124721"
    1 ETP111 exit code           : "8"
    1 ETP199 ######################################
    System properties:
    SAP - BI7.0 with EHP1
    Database - MSSQL 2000
    OS - Windows2003
    Please suggest.
    Thanks in advance,
    Pavan.

    > We have installed EHP1 on our BI7.0 system successfully, later we are trying to apply SPS01 for this EHP but we got the follwoing error during TBATG conversion.
    > 2 ED0314 Line 1: Incorrect syntax near '('.
    > 3 EDA093 "DDL time(___1):" ".........6" milliseconds
    > 2EEGT236 The SQL statement was not executed
    This is a known problem with SQL Server 2000, see
    Note 1180553 - Syntax error 170 during index creation on SQL 2000
    I highly suggest upgrading to SQL Server 2005 or 2008.
    Markus

  • More than one index for a column.

    Hi,
    I am trying to create more than one index for a particular column of the table.But oracle does not allow more than one index for a column.
    I just want to make sure whether we can add more than one index for a column
    and if yes what are the scenarios.
    Because as far as i know some database allows more than one index for a single column.

    You cannot create more than one index for the same column(s).This is not so true Nicolas. Look at following example:
    SQL> create index idx_mytest_id on mytest(id);
    Index created.
    SQL> create index idx_mytest_id_desc on mytest(id desc);
    Index created.
    SQL> create index idx_fbi_mytest_id_upper on mytest(upper(id));
    Index created.
    SQL> create index idx_fbi_mytest_id_upper_desc on mytest(upper(id) desc);
    Index created.
    SQL> create index idx_fbi_mytest_id_lower_id on mytest(lower(id));
    Index created.
    SQL> create index idx_fbi_mytest_id_lower_id_dsc on mytest(lower(id) desc);
    Index created.
    SQL> create index idx_fbi_mytest_id_tr_up on mytest(trunc(upper(id)));
    Index created.
    -- I can still continue but for this example this will be enough
    SQL> select index_name from dba_indexes where table_name = 'MYTEST';
    INDEX_NAME                                                                                                    
    IDX_MYTEST_ID                                                                                                 
    IDX_FBI_MYTEST_ID_UPPER                                                                                       
    IDX_MYTEST_ID_DESC                                                                                            
    IDX_FBI_MYTEST_ID_UPPER_DESC                                                                                  
    IDX_FBI_MYTEST_ID_LOWER_ID                                                                                    
    IDX_FBI_MYTEST_ID_LOWER_ID_DSC                                                                                
    IDX_FBI_MYTEST_ID_TR_UP                                                                                       
    7 rows selected.You can see 7 indexes for one column (ID) and I could still continue...
    So according this test we can say you can't create more than one index for one column (or the same group of columns in case of composite index) with same condition(s).
    Message was edited by:
    Ivan Kartik
    Or simplified: you can't create the same index for same column(s) twice :-)

  • How to use Pivot function for group range in oracle SQL

    Hi,
    Good Morning !!!
    I need to show the data in the below format. There is 2 columns 1 is State and another one is rate.
    State     <100     100-199     200-299     300-399     400-499     500-599     600-699     700-799     800-899     900-999     >=1000     Total
    AK     1     2     0     4     1     4     4     35     35     4     1     25
    AL     0     0     2     27     10     17     35     2     2     35     0     103
    AR     0     0     1     0     0     2     2     13     13     2     0     6
    AZ     0     1     2     14     2     14     13     3     3     13     0     57
    CA     0     0     1     6     2     7     3     4     4     3     0     34
    Developed the below query but unable to use the range on pivot function . Please help on this.
    (select      (SELECT SHORT_DESCRIPTION
         FROM CODE_VALUES
         WHERE CODE_TYPE_CODE = ad.STATE_TYPE_IND_CODE
         AND VALUE = ad.STATE_CODE
         ) STATE,
    nr.rate
         FROM neutrals n,
         contacts c,
         addresses ad,
         xref_contacts_addresses xca,
         neutral_rates nr
                        where n.contact_id=c.contact_id
                        and n.address_id = ad.address_id
                        and xca.address_id=ad.address_id
                        and xca.contact_id=c.contact_id
                        and nr.contact_id = n.contact_id
                        and nr.rate_frequency='HOUR' )

    user8564931 wrote:
    This solutions is useful and Thanks for your reply.
    How can i get the Min value and Max value for each row ?
    State     <100     100-199     200-299     300-399     400-499     500-599     600-699     700-799     800-899     900-999     >=1000     Total     Min     Max
    IL     0     0     1     5     1     5     40     1     1     40     0     53     $10     $2,500
    IN     0     0     0     0     0     0     1     49     49     1     0     3     $70     $1,500This?
    WITH t AS
            (SELECT 'AL' state, 12 VALUE FROM DUAL
             UNION ALL
             SELECT 'AL' state, 67 VALUE FROM DUAL
             UNION ALL
             SELECT 'AL' state, 23 VALUE FROM DUAL
             UNION ALL
             SELECT 'AL' state, 12 VALUE FROM DUAL
             UNION ALL
             SELECT 'AL' state, 12 VALUE FROM DUAL
             UNION ALL
             SELECT 'AL' state, 78 VALUE FROM DUAL
             UNION ALL
             SELECT 'AL' state, 34 VALUE FROM DUAL
             UNION ALL
             SELECT 'AL' state, 4 VALUE FROM DUAL
             UNION ALL
             SELECT 'AL' state, 12 VALUE FROM DUAL
             UNION ALL
             SELECT 'AL' state, 15 VALUE FROM DUAL
             UNION ALL
             SELECT 'AZ' state, 6 VALUE FROM DUAL
             UNION ALL
             SELECT 'AZ' state, 123 VALUE FROM DUAL
             UNION ALL
             SELECT 'AZ' state, 123 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 23 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 120 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 456 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 11 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 24 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 34 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 87 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 23 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 234 VALUE FROM DUAL
             UNION ALL
             SELECT 'MA' state, 789 VALUE FROM DUAL
             UNION ALL
             SELECT 'MH' state, 54321 VALUE FROM DUAL),
         -- End of test data
         t1 AS
            (  SELECT state,
                      NVL (COUNT (DECODE (VALUE, 0, 0)), 0) "<100",
                      NVL (COUNT (DECODE (VALUE, 1, 1)), 0) "100-199",
                      NVL (COUNT (DECODE (VALUE, 2, 2)), 0) "200-299",
                      NVL (COUNT (DECODE (VALUE, 3, 3)), 0) "300-399",
                      NVL (COUNT (DECODE (VALUE, 4, 4)), 0) "400-499",
                      NVL (COUNT (DECODE (VALUE, 5, 5)), 0) "500-599",
                      NVL (COUNT (DECODE (VALUE, 6, 6)), 0) "600-699",
                      NVL (COUNT (DECODE (VALUE, 7, 7)), 0) "700-799",
                      NVL (COUNT (DECODE (VALUE, 8, 8)), 0) "800-899",
                      NVL (COUNT (DECODE (VALUE, 9, 9)), 0) "900-999",
                      NVL (COUNT (DECODE (VALUE, 10, 10)), 0) ">=1000"
                 FROM (SELECT state,
                              CASE
                                 WHEN VALUE < 100 THEN 0
                                 WHEN VALUE BETWEEN 100 AND 199 THEN 1
                                 WHEN VALUE BETWEEN 200 AND 299 THEN 2
                                 WHEN VALUE BETWEEN 300 AND 399 THEN 3
                                 WHEN VALUE BETWEEN 400 AND 499 THEN 4
                                 WHEN VALUE BETWEEN 500 AND 599 THEN 5
                                 WHEN VALUE BETWEEN 600 AND 699 THEN 6
                                 WHEN VALUE BETWEEN 700 AND 799 THEN 7
                                 WHEN VALUE BETWEEN 800 AND 899 THEN 8
                                 WHEN VALUE BETWEEN 900 AND 999 THEN 9
                                 WHEN VALUE >= 1000 THEN 10
                              END
                                 VALUE
                         FROM t)
             GROUP BY state)
    SELECT STATE,
           "<100",
           "100-199",
           "200-299",
           "300-399",
           "400-499",
           "500-599",
           "600-699",
           "700-799",
           "800-899",
           "900-999",
           ">=1000",
             "<100"
           + "100-199"
           + "200-299"
           + "300-399"
           + "400-499"
           + "500-599"
           + "600-699"
           + "700-799"
           + "800-899"
           + "900-999"
           + ">=1000"
              total,
         least("<100",
           "100-199",
           "200-299",
           "300-399",
           "400-499",
           "500-599",
           "600-699",
           "700-799",
           "800-899",
           "900-999",
           ">=1000") min_val,
          greatest("<100",
           "100-199",
           "200-299",
           "300-399",
           "400-499",
           "500-599",
           "600-699",
           "700-799",
           "800-899",
           "900-999",
           ">=1000") max_val
      FROM t1
    /

Maybe you are looking for

  • Bridge stopped working

    Using windows 7 64 bit and Adobe Master Collection CS5.1  Been in use on machine over a year with no problems. I was importing photos from the files of a DVD slideshow. I removed the DVD from the computer and did not wait for the cashe to rebuild. Th

  • Function Module To Obtain Wage Type Characteristics

    Hi Gurus, Is there a FM to obtain the characteristics of a wage type. What I am after is whether a particular wage type is an amount wage type or a number/unit wage type. Many thanks in advance. Raj

  • Which CPU should I buy to support hardware virtualisation

    I would like to buy a cpu/motherboard bundle , but I want it to definately support "hardware virtualisation" . Am having great difficulty in find clear and easy to read info as to which CPU does or does not support hardware virtualisation. are there

  • Bookmarks from IE

    I have downloaded bookmarks from IE. Do I need to keep IE on my system in order to keep the bookmarks or are they now a permanent part of FF

  • Positioning an image

    <a href = "#" class = "navbar-brand"><img src="img/logo.png" /> </a> How do i position my logo. I need to position it a certaint distance from the top. Do i use css and make a div around this. I tried that and it didnt work.