Wrong estimation of ROWS and COST

Oracle Version : 11.2.0.7
Below plan is estimating cost as 0 and rows as 1, all the tables are having statistics on them.
Could any one help me in finding the reason for wrong estimation of Cost and Rows .
select           BIT.BIT_id as BITId,
          BIT.BIT_tp as BITType,
          BIT.rgs_cd as rgsCd,
          BIT.source_priority as sourcePriority,
          BIT.grp as grp,
          BIT.prd_item_id as prdItemId,
          BIT.prt_dt as printDate,
          BIT.partition_key as partitionKey,
          BIT.guid,
          BIT.image_guid,
          BIT.full_pub_fl ,
          monument.doc_tp as monumentType
from           BIT ,
          monument,
          abbba_BIT,
          drag,
          soft_INDEX
where
          BIT.group_id in (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24, :25)
          and BIT.partition_key = :26
          and BIT.BIT_id=monument.BIT_id (+)
          and BIT.BIT_id=abbba_BIT.abbba_BIT_ID
          and BIT.partition_key=abbba_BIT.partition_key
          and abbba_BIT.abbba_BIT_ID=drag.abbba_BIT_ID (+)
          and BIT.BIT_id=soft_INDEX.BIT_id
          and BIT.partition_key=soft_INDEX.partition_key
          and soft_INDEX.partition_key = :28
          and abbba_BIT.partition_key = :27
          and drag.drag_NO in (:29, :30, :31, :32, :33)
          and BIT.del_fl = :34
order by NLSsoft(soft_INDEX.INDEX_QRY_NUM, 'NLS_soft = binary'),
          BIT.source_priority,
          NLSsoft(soft_INDEX.INDEX_DOM_EXT, 'NLS_soft =binary'),
          BIT.ref_noReal Time SQL Monitoring Report:
Global Information
Status              :  EXECUTING
Instance ID         :  3
Session ID          :  2941
SQL ID              :  1htru5m48h2cs
SQL Execution ID    :  50331658
Plan Hash Value     :  3421880714
Execution Started   :  03/01/2013 14:03:20
First Refresh Time  :  03/01/2013 14:03:27
Last Refresh Time   :  03/02/2013 09:43:08
| Elapsed |   Cpu   |    IO    | Concurrency | Cluster  |  Other   | Buffer | Reads |
| Time(s) | Time(s) | Waits(s) |  Waits(s)   | Waits(s) | Waits(s) |  Gets  |       |
|   70788 |   66482 |     0.16 |        1135 |     0.16 |     3170 |  2267M |     3 |
SQL Plan Monitoring Details
==========================================================================================================================================================================
| Id    |                  Operation                   |      Name      |  Rows   | Cost |   Time    | Start  | Starts |   Rows   | Memory | Activity  | Activity Detail |
|       |                                              |                | (Estim) |      | Active(s) | Active |        | (Actual) |        | (percent) |   (sample #)    |
==========================================================================================================================================================================
|     0 | SELECT STATEMENT                             |                |         |    7 |           |        |      1 |          |        |           |                 |
|     1 |   SORT ORDER BY                              |                |       1 |    7 |     23645 |  +2715 |      1 |        0 |        |           |                 |
|     2 |    FILTER                                    |                |         |      |     23645 |  +2715 |      1 |       37 |        |           |                 |
|     3 |     NESTED LOOPS                             |                |         |      |     23645 |  +2715 |      1 |       37 |        |           |                 |
|     4 |      NESTED LOOPS                            |                |       1 |    6 |     27708 |     +7 |      1 |       37 |        |           |                 |
|     5 |       NESTED LOOPS OUTER                     |                |       1 |    3 |     27708 |     +7 |      1 |      364 |        |           |                 |
|  -> 6 |        NESTED LOOPS                          |                |       1 |    0 |     70782 |     +7 |      1 |      364 |        |           |                 |
|  -> 7 |         MERGE JOIN CARTESIAN                 |                |       1 |    0 |     70782 |     +7 |      1 |    8418K |        |           |                 |
|     8 |          PARTITION RANGE SINGLE              |                |       1 |    0 |     70766 |     +7 |      1 |     1256 |        |           |                 |
|  -> 9 |           INDEX RANGE SCAN                   | ABBBA_BIT_AK2  |       1 |    0 |     70782 |     +7 |      1 |     1256 |        |           |                 |
|    10 |          BUFFER SORT                         |                |       1 |    0 |     70782 |     +7 |   1256 |    8418K |   338K |      0.03 | Cpu (4)         |
|    11 |           PARTITION RANGE SINGLE             |                |       1 |    0 |         1 |     +7 |      1 |     6705 |        |           |                 |
|    12 |            TABLE ACCESS BY LOCAL INDEX ROWID | SOFT_INDEX     |       1 |    0 |         1 |     +7 |      1 |     6705 |        |           |                 |
|    13 |             INDEX RANGE SCAN                 | SOFT_INDEX_BK1 |       1 |    0 |         1 |     +7 |      1 |     6705 |        |           |                 |
|    14 |         PARTITION RANGE SINGLE               |                |       1 |    0 |     68305 |     +7 |  8418K |      364 |        |      0.04 | Cpu (5)         |
| -> 15 |          TABLE ACCESS BY LOCAL INDEX ROWID   | BIT            |       1 |    0 |     70783 |     +7 |  8418K |      364 |        |     81.90 | Cpu (11320)     |
|    16 |           INDEX RANGE SCAN                   | BIT_BK3        |       1 |    0 |     70782 |     +7 |  8418K |    4295M |        |     18.03 | Cpu (2492)      |
|    17 |        TABLE ACCESS BY INDEX ROWID           | MONUMENT       |       1 |    3 |           |        |    364 |          |        |           |                 |
|    18 |         INDEX RANGE SCAN                     | MONUMENT_IF2   |       1 |    2 |           |        |    364 |          |        |           |                 |
|    19 |       INDEX RANGE SCAN                       | DRAG_IF1       |       1 |    2 |     23645 |  +2715 |    364 |       37 |        |           |                 |
|    20 |      TABLE ACCESS BY INDEX ROWID             | DRAG           |       1 |    3 |     23645 |  +2715 |     37 |       37 |        |           |                 |
==========================================================================================================================================================================Execution plan fetched using dbms_xplan.display_cursor.
| Id  | Operation                                  | Name           | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
|   0 | SELECT STATEMENT                           |                |       |       |     7 (100)|          |       |       |
|   1 |  SORT ORDER BY                             |                |     1 |  1759 |     7  (15)| 00:00:01 |       |       |
|*  2 |   FILTER                                   |                |       |       |            |          |       |       |
|   3 |    NESTED LOOPS                            |                |       |       |            |          |       |       |
|   4 |     NESTED LOOPS                           |                |     1 |  1759 |     6   (0)| 00:00:01 |       |       |
|   5 |      NESTED LOOPS OUTER                    |                |     1 |  1749 |     3   (0)| 00:00:01 |       |       |
|   6 |       NESTED LOOPS                         |                |     1 |  1730 |     0   (0)|          |       |       |
|   7 |        MERGE JOIN CARTESIAN                |                |     1 |   968 |     0   (0)|          |       |       |
|   8 |         PARTITION RANGE SINGLE             |                |     1 |    26 |     0   (0)|          |   KEY |   KEY |
|*  9 |          INDEX RANGE SCAN                  | ABBBA_BIT_AK2  |     1 |    26 |     0   (0)|          |   KEY |   KEY |
|  10 |         BUFFER SORT                        |                |     1 |   942 |     0   (0)|          |       |       |
|  11 |          PARTITION RANGE SINGLE            |                |     1 |   942 |     0   (0)|          |   KEY |   KEY |
|  12 |           TABLE ACCESS BY LOCAL INDEX ROWID| SOFT_INDEX     |     1 |   942 |     0   (0)|          |   KEY |   KEY |
|* 13 |            INDEX RANGE SCAN                | SOFT_INDEX_BK1 |     1 |       |     0   (0)|          |   KEY |   KEY |
|  14 |        PARTITION RANGE SINGLE              |                |     1 |   762 |     0   (0)|          |   KEY |   KEY |
|* 15 |         TABLE ACCESS BY LOCAL INDEX ROWID  | BIT            |     1 |   762 |     0   (0)|          |   KEY |   KEY |
|* 16 |          INDEX RANGE SCAN                  | BIT_BK3        |     1 |       |     0   (0)|          |   KEY |   KEY |
|  17 |       TABLE ACCESS BY INDEX ROWID          | MONUMENT       |     1 |    19 |     3   (0)| 00:00:01 |       |       |
|* 18 |        INDEX RANGE SCAN                    | MONUMENT_IF2   |     1 |       |     2   (0)| 00:00:01 |       |       |
|* 19 |      INDEX RANGE SCAN                      | DRAG_IF1       |     1 |       |     2   (0)| 00:00:01 |       |       |
|* 20 |     TABLE ACCESS BY INDEX ROWID            | DRAG           |     1 |    10 |     3   (0)| 00:00:01 |       |       |
Predicate Information (identified by operation id):
   2 - filter((:27=:28 AND :28=:26 AND :27=:26))
   9 - access("ABBBA_BIT"."PARTITION_KEY"=:28)
       filter(("ABBBA_BIT"."PARTITION_KEY"=:27 AND "ABBBA_BIT"."PARTITION_KEY"=:26))
  13 - access("SOFT_INDEX"."PARTITION_KEY"=:26)
       filter(("SOFT_INDEX"."PARTITION_KEY"=:28 AND "SOFT_INDEX"."PARTITION_KEY"=:27))
  15 - filter(("BIT"."DEL_FL"=:34 AND INTERNAL_FUNCTION("BIT"."GROUP_ID") AND
              "BIT"."BIT_ID"="ABBBA_BIT"."ABBBA_BIT_ID" AND "BIT"."BIT_ID"="SOFT_INDEX"."BIT_ID"))
  16 - access("BIT"."PARTITION_KEY"=:28)
       filter(("BIT"."PARTITION_KEY"=:26 AND "BIT"."PARTITION_KEY"=:27))
  18 - access("BIT"."BIT_ID"="MONUMENT"."BIT_ID")
       filter("MONUMENT"."BIT_ID" IS NOT NULL)
  19 - access("ABBBA_BIT"."ABBBA_BIT_ID"="drag"."ABBBA_BIT_ID")
  20 - filter(("DRAG"."DRAG_NO"=:29 OR "DRAG"."DRAG_NO"=:30 OR "DRAG"."DRAG_NO"=:31 OR "DRAG"."DRAG_NO"=:32 OR
              "DRAG"."DRAG_NO"=:33))Edited by: Yasu on Mar 3, 2013 12:53 AM

why you you waste your time & our time since you rarely get answers to your questions here?You are right, even i felt that recently. Its my mistake that i did not care to mark most of my threads as answered. Does that state i need to go back and mark all my old threads as answered ?
My role is some what isolated, i have to do it on my own. So some times i think of posting questions here in hope of getting some clues but at the same time i don't feel bad if i don't get answers, since i have learned a lot from this forum.
TABLE_NAME                       NUM_ROWS LAST_ANALYZED
MONUMENT                          7978540 22-FEB-13
DRAG                               406030 20-FEB-13
BIT                             121783270 02-MAR-13
SOFT_INDEX                      119212340 26-FEB-13
ABBBA_HIT                       121276950 22-FEB-13Edited by: Yasu on Mar 3, 2013 9:40 AM

Similar Messages

  • Sourcing: Shows wrong company code and cost center

    Hello
    We have implemented SRM4.0 SP8. When we display shopping carts in sourcing cockpit before aggregate to create a PO, we check that SC from different companies doesn’t show the correct company code and cost center. We have a central purchase group that aggregates SC from different enterprises. For two SC, the second displays a wrong company code and cost center.
    Example:
    First SC:
    SC -> A123
    Company -> SNLL
    Cost center –> AAA
    Second SC:
    SC -> A124
    Company -> SNPP
    Const center -> BBB
    When displaying the second SC it shows company code SNLL and Cost center AAA each is incorrect. In DB data is correct for each SC, company code (table BBP_PDBEI) and cost center per item (BBP_PDACC). Even if we aggregate both SC to create one PO, this document has correct data per item (different company code, requester, cost center) the only issue is related with the information showed in ITS/HTML in sourcing cockpit before aggregation.
    Do you have any idea how can we resolve this?
    Thanks in advance

    Hi
    Seems like a SRM bug.. with the Support pack 8... Try upgrade to latest support pack in SRM system, if possible...
    Also Please create a customer OSS message with SAP !!
    Do let me know.
    Regards
    - Atul

  • Wrong estimation

    I have created filtered index on table:
    CREATE NONCLUSTERED INDEX [ix_test] ON [dbo].[myTable]
    (col0 ASC)
    INCLUDE (col1)
    WHERE (col2 IN(1,2,3))
    ON [PRIMARY]
    GO
    col2 is TINYINT data type.
    Then i have query like this:
    SELECT col1 FROM dbo.myTable WHERE col2 IN(1,2,3)
    From execution plan I can see, that my filtered index was used as expected. But estimated number of rows is 8280, actual is higher, 9507. Because of wrong estimation, I get sort warning (in my real query).
    How should I repair estimations? There is index statistic created by default, but should i create some other statistic?
    br, Simon

    As i can see, filtered statistics is created by default at filtered index?
    Anyway, that was not the main problem for sort warning.
    I have created one example:
    CREATE TABLE [dbo].[order_header](
    [header_id] [int] NOT NULL,
    [order_date] [datetime] NOT NULL,
    [order_status] [tinyint] NOT NULL,
    CONSTRAINT [PK_order_header] PRIMARY KEY CLUSTERED ([header_id] ASC)
    CREATE TABLE [dbo].[order_item](
    [header_id] [int] NOT NULL,
    [item_id] [varchar](20) NOT NULL,
    [date_created] [datetime] NOT NULL,
    [quantity] [int] NOT NULL,
    [last_item] [bit] NOT NULL,
    [item_finished] [bit] NULL,
    CONSTRAINT [PK_order_item] PRIMARY KEY CLUSTERED ([header_id] ASC,[item_id] ASC,[date_created] ASC)
    GO
    DECLARE @headerID INT, @itemID INT, @dt datetime
    SET @headerID = 1
    WHILE @headerID < 1000
    BEGIN
    INSERT INTO dbo.order_header ( header_id, order_date, order_status)
    VALUES (@headerID, GETDATE(), ABS(Checksum(NewID()) % 4)+1)
    SET @itemID=1
    WHILE @itemID < 20
    BEGIN
    INSERT INTO dbo.order_item ( header_id, item_id, date_created, quantity, last_item, item_finished)
    VALUES (@headerID, 'PROD'+CAST(@itemID as varchar(20)), DATEADD(dd, -@itemID, GETDATE()), CAST(100*RAND() AS INT), 1, @itemID % 2)
    SET @itemID = @itemID + 1
    END
    SET @headerID = @headerID + 1
    END
    SET @dt='20140314 08:00:00'
    INSERT INTO dbo.order_item ( header_id, item_id, date_created, quantity, last_item, item_finished)
    SELECT header_id, item_id, DATEADD(dd, -ROW_NUMBER() OVER(ORDER BY header_id), @dt), quantity, 0, 0 FROM dbo.order_item
    SET @dt='20140313 09:00:00'
    INSERT INTO dbo.order_item ( header_id, item_id, date_created, quantity, last_item, item_finished)
    SELECT header_id, item_id, DATEADD(dd, -ROW_NUMBER() OVER(ORDER BY header_id), @dt), quantity, 0, 0 FROM dbo.order_item
    UPDATE dbo.order_header SET order_status=4 WHERE header_id<900
    CREATE NONCLUSTERED INDEX [ix_status] ON [dbo].[order_header]([order_status] ASC) WHERE ([order_status] IN ((1), (2), (3)))
    CREATE NONCLUSTERED INDEX [ix_opened] ON [dbo].[order_item] ([header_id] ASC) INCLUDE (quantity)  WHERE ([item_finished]=0 AND [last_item]=1)
    Now, if you execute this statement:
    SELECT i.quantity, h.order_status
    FROM dbo.order_header h WITH (INDEX(ix_status)) INNER JOIN dbo.order_item i ON h.header_id = i.header_id
    WHERE i.item_finished=0 AND i.last_item=1 AND h.order_status IN(1, 2, 3)
    You can see from execution plan that at merge join there is estimated number of rows 1344, but actual are 702.
    Is it possible to force optimizer to have more accurate assumptions?
    In real example, I have the same tables with more rows and columns and with different data distribution.
    There I get estimated number of rows 6337,84, but actual is 10 times greater: 66941.
    And that is the reason for sort warning and performance problems.
    What would be the best solution for better estimations?

  • Problems copying a row and pasting it in the following row

    Hi all,
    In a Numbers table I have 400 rows with data separated each one by a blank row
    row 2 has data
    row 3 is blank
    row 4 has data
    row 5 is blank ... and so on.
    I have prepared a small script to copy row 2 into row 3, row 4 into row 5,... as follows:
    set dName to "Conta"
    set sName to "Movis"
    set tName to "Pruebas"
    set row_ini to 2
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    set selection range to row row_ini
    repeat
    if value of first cell of selection range = 0 then
    exit repeat
    else
    tell application "System Events"
    keystroke "c" using {command down}
    keystroke return
    keystroke "v" using {command down}
    end tell
    tell first cell of the selection range to set rowNum to address of its row
    set selection range to row (rowNum + 1)
    end if
    end repeat
    end tell
    The idea is:
    1 select the initial row (in this case row 2)
    2 check if the value of first cell of the row is cero, then exit the repeat loop
    3 else
    4 copy the entire row, move down a row and paste.
    5 move to the next row
    6 repeat
    The first time I run the script it worked until the row 124 and stopped. I tried again changing the inicial row and it worked only for 7 rows. The third time it erased all the cells with data. I've tried closing both the table and the script but the problems persists: in this case it stops after replacing 5 rows.
    Where am I wrong?
    Thank you in advance
    Ratz

    KOENIG Yvan wrote:
    There is not such a book.
    There is just on short chapter dedicated to iWork in :
    Hanaan Rosenthal & Hamish Sanderson, Learn AppleScript: The Comprehensive
    Guide to Scripting and Automation on Mac OS X, Third Edition, Apress (2010);
    ISBN 978-1-4302-2361-0
    You may find useful infos in my idisk :
    <http://public.me.com/koenigyvan>
    Scan the contents of the folder :
    For_iWork:iWork '09:for_Numbers09.
    I guess the problem is for using the tell application block without telling the process Numbers.
    No, I had to change a lot of things.
    the name of the document was wrong (at least on my machine on which I always use the name extension.
    set selection range … was wrong.
    Yvan KOENIG (VALLAURIS, France) dimanche 20 février 2011 23:02:35
    Thank you.
    Visiting your idisk I realise how much work I must do to become a decent scripter!
    The book you mention looks interesting. I'm going to include it in my bookcase (and read it, of course).
    Ratz

  • BI-IP - Bex Analyser - select excel single row and aplly planning function

    Hi experts,
    In BI-IP (BW 7) with Bex Analyser, is it possible to select a single excel row (or a range of rows) and then apply a planning function? I know that in WAD it's possible with the binding option to select a single web item.
    The purpose is to apply a revaluation factor to selected (by the user) cost elements rows in the workbook.
    Thanks and regards,
    MA

    Hi
    It is possibel in WAD to select one or many rows while executing Functions such as--Reposting; Revaluation etc.
    However, you should be in a position to select the rows based on....unique identifier such as Require ID; Request #; Serial #; ....this is more so in case of multiple entries for the same cost element for different combinations.
    Regards
    Srinivas

  • BI FI and Cost Centre Reconciliation

    Hi
    I have a requriement to create a GL reconciliation report between Finance and Cost centre data, i have a multi sitting over the relevant cubes and the data is coming through.
    The report is as follows
                     |_FI Total__|___Cost Centre Total__|__Difference_(should = 0)
    GL Account |                  |                                  |                   
    For the cost centre data the report should bring through the data where the cost element = GL account in the row,
    ie GL Account - 60000
    FI Total - GL Account - 60000
    CC Total - Cost Element - 60000
    Difference - FI - CC
    Any ideas on how i can do this or if this is possible?
    Thanks
    Josh

    Hi Harshal
    Yes i was able to create this report, i had to create an infoobject ZFI_GLCE with 0GL_ACCOUNT as a ref. characteristic.
    Then i created a cube and had transformation going from YCOOM_C02 (CO-OM: Costs and Allocations (Delta Extraction)) to the cube where i mapped the Cost Element to ZFI_GLCE and then also had another transformation from YFIGLO02 (General Ledger: Line Items) to the cube mapping the GL Account to ZFI_GLCE.
    Could you further explain the problem you are having with the GL Accounts?
    Josh

  • Control G/L account and Cost Center for movement type 251

    Dear Friends,
    I would like to use mov. type 251 for GI for sale and like to control over G/L account and Cost center.
    The G/L account is by default from the valuation class of the the material and if the user will enter wrong G/L
    we had done the customising in OMJJ movement type 251 - Account grouping - Unchecked the check box of column
    "Check account assignment" - Impact is " the system always uses the G/L accounts or account assignments determined automatically"
    I also made default cost center for G/L account and plant wise through OKB9.
    Now I would like to suppress/dispaly the G/L account and cost center - for same I had done Setting in Entry control menu of OMJJ for 251 of field Account control - Value  - "-" field is suppressed. But it is not working.
    Please advise to solve this situation.
    Thanks & Regards
    Rajan

    Dear Rajan
    Yes, I have checked in MB1A earlier. We have separate node for Field seletion layout for Enjoy transaction MIGO for mvt type in which the G/L account (KONTO) an Cost center (KOSTL) have only optional or required entry selection.
    warm regards
    Ramakrishna.

  • BAPI KPF6 POST PLAN COST FOR INTERNAL ORDER AND COST ELEMENT

    Hi all gurus,
    I would like to use in a custom report a BAPI/Function Module that help me to simulate KPF6 in order to post planning costs for internal order and cost element (layout 1-401).
    So the input should be:
    1) Version
    2) period from
    3) periodo to
    4) year
    5) internal order n.
    6) cost element n.
    7) value
    I found a lot of BAPI but don't know the correct one and how to use it (example how to fill the input value).
    Can anyone help me on that?
    Kind Regards

    In additio  to the previous I found the BAPI_COSTACTPLN_POSTPRIMCOST but don't know if it's the correct one and how to use it (some example fitting the my case will be very appreciated).
    If the quoted BAPI is correct.
    I tested it filling all fields as following:
    HEADERINFO:
    CO_AREA=FFCA
    FISC_YEAR=2008
    PERIOD_FROM=001
    PERIOD_TO=012
    DOC_HDR_TX='blank'
    INDEXSTRUCTURE:
    OBJECT_INDEX=000001
    VALUE_INDEX=000004 (hope this point at Interna Order)
    ATTRIB_INDEX=000000
    COOBJECT:
    OBJECT_INDEX=000001
    ORDERID=ZO53-08IMZ
    TOTVALUE:
    VALUE_INDEX=000004
    COST_ELEM=3224048
    FIX_VALUE= 200,0000
    DIST_KEY_FIX_VAL=2
    The Return table is set to 0. Nothing happens.....I suspect something related to indexstructure or index is wrong..
    Could anyone help me on that?
    Kind Regards

  • Calculated key-figures are wrong in result rows

    Hi,
    I developed a BEx query which shows profi-centers and materials in the rows, and the price, the amount and the amount-value in the columns.
    Price and amount are basic key-figures on the cube, the value is calculated via a calculated key-figure in the query (price*amount).
    Now I have added result rows an profit-center level in the workbook. Everything works fine, BUT when I hide the materials, the result-row on profit-center level is calculated wrong.
    Is there any possibility to hide the material-lines without having the resul-rowts calculated wrong? Is there any feature like "caculate material in background but hide in the workbook"?
    I don´t like to create other basic key-figures on cube level, as this is only an example for lots of calculated key-figures which I use.
    Thanks for your help,
    Patrick

    Hi Patrick,
    Since the prices and amounts are on the material level, therefore the calculation for amount value will be correctly done only when you have materials in the rows.
    Now when you hide the materials, then the system would not know on what basis to do the calculation: I'll explain with an example.
    Let's take four materials which have the same profit center assignment. But the prices for each of them are different and so are the amounts. Now if you remove the materials from the rows, then say the system calculates amount-value by taking the average price and multiply that with the total amount of the four materials. That would also give an incorrect result - isn't it?
    So there is no way to define what the system should do when material is removed from the rows.
    So material would be the minimum required granularity for such a report to show correct results.
    Regards,
    Shweta

  • How to corret an execution plan that shows wrong number of rows?

    Using Oracle 10gR2 RAC (10.2.0.3) on SUSE Linux 9 (x86_64).
    I have a partition table that has 5 million rows (5,597,831). However an execution plan against the table show that the table has 10 million rows.
    Execution plan:
    SELECT STATEMENT ALL_ROWS Cost : 275,751 Bytes : 443 Cardinality : 1
    3 HASH GROUP BY Cost : 275,751 Bytes : 443 Cardinality : 1
         2 PARTITION RANGE ALL Cost : 275,018 Bytes : 4,430,000,000 Cardinality : *10,000,000* Partition # : 2 Partitions accessed #1 - #6
              1 TABLE ACCESS FULL TRACESALES.TRACE_BUSINESS_AREA Cost : 275,018 Bytes : 4,430,000,000 Cardinality : 10,000,000 Partition # : 2 Partitions accessed #1 - #6
    Plan hash value: 322783426
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 1 | 443 | 275K (2)| 00:55:10 | | |
    | 1 | HASH GROUP BY | | 1 | 443 | 275K (2)| 00:55:10 | | |
    | 2 | PARTITION RANGE ALL| | 10M| 4224M| 275K (2)| 00:55:01 | 1 | 6 |
    | 3 | TABLE ACCESS FULL | TRACE_BUSINESS_AREA | 10M| 4224M| 275K (2)| 00:55:01 | 1 | 6 |
    How does one correct the explain plan?
    The problem: Queries against the table are taking hours to complete. The problem started when the table was dropped then recreated with a new partition.
    I have complete the drop and creation against several tables for several years without problems until now.
    I have done the following: Analyzed statistics against the table, flushed buffer cache. Created a materialized view.
    However users queries are taking several hours to complete, where before the addition of the partition the queries where taking 5 minutes to complete.
    Thanks. BL.

    Yes, complete analysis of statistic was complete on indexes and against partitions.
    Table creation statement:
    CREATE TABLE TRACESALES.TRACE_BUSINESS_AREA
    ... *(400 columns)*
    TABLESPACE "trace_OLAPTS"
    PCTUSED 0
    PCTFREE 15
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 1M
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL KEEP
    PARTITION BY RANGE (YEAR)
    PARTITION TRACE_06 VALUES LESS THAN ('2007')
    NOLOGGING
    NOCOMPRESS
    TABLESPACE TRACE_2006
    PCTFREE 15
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 1M
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    PARTITION TRACE_07 VALUES LESS THAN ('2008')
    NOLOGGING
    NOCOMPRESS
    TABLESPACE TRACE_2007
    PCTFREE 15
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 1M
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    PARTITION TRACE_08 VALUES LESS THAN ('2009')
    NOLOGGING
    NOCOMPRESS
    TABLESPACE TRACE_2008
    PCTFREE 15
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 1M
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    PARTITION TRACE_09 VALUES LESS THAN ('2010')
    NOLOGGING
    NOCOMPRESS
    TABLESPACE TRACE_2009
    PCTFREE 15
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 1M
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    PARTITION TRACE_10 VALUES LESS THAN ('2011')
    NOLOGGING
    NOCOMPRESS
    TABLESPACE TRACE_2010
    PCTFREE 15
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 1M
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    PARTITION TRACE_11 VALUES LESS THAN (MAXVALUE)
    NOLOGGING
    NOCOMPRESS
    TABLESPACE TRACE_2011
    PCTFREE 15
    INITRANS 1
    MAXTRANS 255
    STORAGE (
    INITIAL 1M
    NEXT 1M
    MINEXTENTS 1
    MAXEXTENTS UNLIMITED
    PCTINCREASE 0
    BUFFER_POOL DEFAULT
    NOCOMPRESS
    CACHE
    PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT )
    MONITORING;
    *(index statements, constraints, triggers and security)*
    Table caching is on and running in parallel degree 4 instances 1.

  • How to Override Company and Cost Center for FI Posting from HR Payroll

    Current problem:  A company code has been 'merged' into another one and the old company code can no longer be used.  In the last payroll run, there was a rate change that caused a retro back to the time of the old company code and since the old company code and cost center were closed, the FI posting error'ed out.  To correct, we had to delete the offending pernr from the cluster and back out the rate change until we came up with a solution. 
    Investigation has revealed a process called 'Substitute Cost Centers', but we tested it and a 'flusher' cost center is required to be set up in the old company code and FI refuses to open it up. 
    Also, I've located 3 user exits for RPCIPE00, but I do not see where  company and cost center can be changed.  So I've tried to code my own BAdi, but there seems to be a header company code that I'm not getting.  The item company code and cost center seem to be doable, but I don't know how to change the header company code.
    I am new to HR and Payroll having spent the last couple of years in BI and before that I worked with the material master and Purchasing.  It is my humble opinion that the company should not have been 'turned off' until Payroll was finished with it and that means 2 years until we archive.  In reading about symbolic accounts, several times it is written not ever to delete them.  Seems to me company code is the same.  But surely I must be wrong and there is a solution that will make everybody happy. 
    I would appreciate any and all ideas.  Thank you so much.

    Amosha, thank you for your response.  Here is PCP0 that shows what I mean by 'header company code' that I don't see how to change (I re-ran pd 26 2008--bi-weekly payroll, btw):
    06/30/2009 Posting Document
    Run                      0000002791
    Company Code    0057
    Document            0000008174
    PostingCurrency  USD
    Reference           HRPAY00009
    Doc. Type            ZB
    Run Type             PP
    Posting Date        12/01/2008
    Documant Type   G/L Account Document   
    Document Date    06/30/2009
    Bus. Transaction HRP1
        There are error messages for this document
    Account Number with Text
    21301000   Accrued Salaries & Wages   CCTR 14515      ...
    20303998   HR P/R Doc Split                                               ...
    Messages for Document 000008174
    Error in document: HRPAY 0000008174
    The CO account assignment object belongs to company code 0001, not 0057
    Company code 0057 is now closed and has been merged into 0001.  Cost center 14515 in the above doc was populated by my clone of RPCIPE00 and call to my BAdI which retrieved current company and cost center from PA0001.  You can see from above that the 'header' data still shows 0057 and indeed, my version of RPCIPE00 only changes P_ITEM-BUKRS, P_ITEM-KOSTL and P_ITEM-SGTXT.  It looks to me that fm HRPP_TRANSLATE_FICO gets the 'header' company code afresh.  I was planning to leave WPBP-BUKRS (and all other Payroll data) alone (ie, not override company code).
    As for your other question, we post retros to /551 and /552. 
    Thanks again.

  • Rows and Colums

    I have a row that states the cost centre and then a column that states a percentage. I then want another row that states a cost centre and then another column that states a percentage. However I cant get these to follow on from each other - I have to have 2 rows and two columns. In earlier versions of BEX (I'm on BI7) I could use the tabular function. Is there anything I can do in this version?

    How are you defining the structure? You need to right click the structure and then choose new selection and then drag your cost center char into it and restrict it.
    Hope this helps...

  • Removing rows and inserting new rows with new data in JTAble!!! (Plz. help)

    I have a problem, The scenario is that when I click any folder that si in my JTable's first row, the table is update by removing all the rows and showing only the contents of my selected folder. Right now it's not removing the rows and instead throwing exceptions. The code is attached. The methods to look are upDateTabel(...) and clearTableData(....), after clearing all my rows then I proceed on adding my data to the Jtable and inserting rows but it's not being done. May be I have a problem in my DefaultTableModel class. Please see the code below what I am doing wrong and how should I do it. Any help is appreciated.
    Thanks
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    import java.io.*;
    import java.text.SimpleDateFormat;
    import java.util.*;
    public class SimpleTable extends JPanel{
         /** Formats the date */
         protected SimpleDateFormat           formatter;
    /** variable to hold the date and time in a raw form for the directory*/
    protected long                          dateDirectory;
    /** holds the readable form converted date for the directories*/
    protected String                     dirDate;
    /** holds the readable form converted date for the files*/
    protected String                     fileDate;
    /** variable to hold the date and time in a raw form for the file*/
    protected long                          dateFile;
    /** holds the length of the file in bytes */
    protected long                         totalLen;
    /** convert the length to the wrapper class */
    protected Long                         longe;
    /** Vector to hold the sub directories */
    protected Vector                     subDir;
    /** holds the name of the selected directory */
    protected String                    dirNameHold;
    /** converting vector to an Array and store the values in this */
    protected File                     directoryArray[];
    /** hashtable to store the key-value pair */
    protected static Hashtable hashTable = new Hashtable();
    /** refer to the TableModel that is the default*/
    protected MyTableModel               tableModel;
    /** stores the path of the selected file */
    protected static String               fullPath;
    /** stores the currently selected file */
    protected static File selectedFilename;
    /** stores the extension of the selected file */
    protected static String           extension;
    protected int COLUMN_COUNT = 4;
         protected Vector data = new Vector( 0, 1 );
         protected final JTable table;
    /** holds the names of the columns */
    protected final String columnNames[] = {"Name", "Size", "Type", "Modified"};
    public SimpleTable(File directoryArray[])
              this.setLayout(new BorderLayout());
              this.setBorder( BorderFactory.createEmptyBorder( 0, 0, 0, 0 ) );
              (SimpleTable.hashTable).clear();
              formatter = new SimpleDateFormat("mm/dd/yyyy hh:mm aaa");
              for(int k = 0; k < directoryArray.length; k++)
                   if(directoryArray[k].isDirectory())
                        dateDirectory = directoryArray[k].lastModified();
                        dirDate = formatter.format(new java.util.Date(dateDirectory));
                        data.addElement( new MyObj( directoryArray[k].getName(), "", "File Folder", "" + dirDate ) );
                        (SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);                    
                   else if(directoryArray[k].isFile())
                        dateDirectory = directoryArray[k].lastModified();
                        fileDate = formatter.format(new java.util.Date(dateDirectory));
                        totalLen = directoryArray[k].length();
                        longe = new Long(totalLen);
                        data.addElement( new MyObj( directoryArray[k].getName(), longe + " Bytes", "", "" + fileDate ) );
                        (SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);
    tableModel = new MyTableModel();
              table = new JTable( tableModel );
              table.getTableHeader().setReorderingAllowed(false);
              table.setRowSelectionAllowed(false);
              table.setBorder( BorderFactory.createEmptyBorder( 0, 0, 0, 0 ) );
              table.setShowHorizontalLines(false);
              table.setShowVerticalLines(false);
              table.addMouseListener(new MouseAdapter()
    public void mouseReleased(MouseEvent e)
         Object eventTarget = e.getSource();
                        if( eventTarget == table )
                             upDateTable(table);
                             table.tableChanged( new javax.swing.event.TableModelEvent(tableModel) ) ;
              DefaultTableCellRenderer D_headerRenderer = (DefaultTableCellRenderer ) table.getTableHeader().getDefaultRenderer();
              table.getColumnModel().getColumn(0).setHeaderRenderer(D_headerRenderer );
              ((DefaultTableCellRenderer)D_headerRenderer).setToolTipText("File and Folder in the Current Folder");
    //Create the scroll pane and add the table to it.
    JScrollPane scrollPane = new JScrollPane(table);
    //Add the scroll pane to this window.
    this.add(scrollPane, BorderLayout.CENTER);
    * Searches the Hashtable and returns the path of the folder or the value.
    public File findPath(String value)
         return (File)((SimpleTable.hashTable).get(value));
    * This clears the previous data in the JTable
    public void clearTableData(JTable table)
         for(int row = 0; row < table.getRowCount() ; row++)
                   //for (int col = 0; col < table.getColumnCount() ; col++)
                        tableModel.deleteSelections( row );
              tableModel.fireTableStructureChanged();
              tableModel.fireTableRowsDeleted(0,table.getRowCount());
              //table.getModel().fireTableChanged(new TableModelEvent(table.getModel()));
    private void upDateTable(JTable table)
    if((table.getSelectedColumn() == 0) && ((table.getColumnName(0)).equals(columnNames[0])))
         dirNameHold =(String) table.getValueAt(table.getSelectedRow(),table.getSelectedColumn());
                   File argument = findPath(dirNameHold);
                   if(argument.isFile())
                        CMRDialog.fileNameTextField.setText(argument.getName());
                        try
                             fullPath = argument.getCanonicalPath();                          
                             selectedFilename = argument.getCanonicalFile();                          
    CMRDialog.filtersComboBox.removeAllItems();
                             extension = fullPath.substring(fullPath.lastIndexOf('.'));
                             CMRDialog.filtersComboBox.addItem("( " + extension + " )" + " File");
                        catch(IOException e)
                             System.out.println("THE ERROR IS " + e);
                        return;
                   else if(argument.isDirectory())
                        String path = argument.getName();
                             //find the system dependent file separator
                             //String fileSeparator = System.getProperty("file.separator");
                        CMRDialog.driveComboBox.addItem(" " + path);
              subDir = Search.subDirs(argument);
              /**TBD:- needs a method to convert the vector to an array and return the array */
              directoryArray = new File[subDir.size()];
                   int indexCount = 0;
                   /** TBD:- This is inefficient way of converting a vector to an array */               
                   Iterator e = subDir.iterator();               
                   while( e.hasNext() )
                        directoryArray[indexCount] = (File)e.next();
                        indexCount++;
              /** now calls this method and clears the previous data */
              clearTableData(table);     
                   (SimpleTable.hashTable).clear();
                   //data = new Object[this.getRowTotal(directoryArray)][this.getColumnTotal()];
                   formatter = new SimpleDateFormat("mm/dd/yyyy hh:mm aaa");
                   for(int k = 0; k < directoryArray.length; k++)
                        if(directoryArray[k].isDirectory())
                             dateDirectory = directoryArray[k].lastModified();
                             dirDate = formatter.format(new java.util.Date(dateDirectory));
                             data.addElement( new MyObj( directoryArray[k].getName(), "", "File Folder", "" + dirDate ) );
                             (SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);                    
                        else if(directoryArray[k].isFile())
                             dateDirectory = directoryArray[k].lastModified();
                             fileDate = formatter.format(new java.util.Date(dateDirectory));
                             totalLen = directoryArray[k].length();
                             longe = new Long(totalLen);
                             data.addElement( new MyObj( directoryArray[k].getName(), longe + " Bytes", "", "" + fileDate ) );
                             (SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);
              // tableModel.fireTableDataChanged();          
              // tableModel.fireTableRowsInserted(0,1);
              table.revalidate();
              table.validate();               
    class MyTableModel extends DefaultTableModel
              int totalRows;
              int totalCols;
              public MyTableModel()
                   super();
                   setColumnIdentifiers (columnNames);
                   this.totalRows = data.size();
                   this.totalCols = columnNames.length;
              // this will return the row count of your table
              public int getRowCount()
                   return totalRows;
              // this return the column count of your table
              public int getColumnCount()
                   return totalCols;
              // this return the data for each cell in your table
              public Object getValueAt(int row, int col)
                   MyObj obj = (MyObj)data.elementAt( row );
                   if( obj != null )
                        if( col == 0 ) return( obj.first );
                        else if( col == 1 ) return( obj.last );
                        else if( col == 2 ) return( obj.third );
                        else if( col == 3 ) return( obj.fourth );
                        else return( "" );
                   return "";
              // if you want your table to be editable then return true
              public boolean isCellEditable(int row, int col)
                   return false;
              // if your table is editable edit the data vector here and
              // call table.tableChanged(...)
              public void setValueAt(Object value, int row, int col)
              protected void deleteSelections (int rows)
                   try
                        removeRow(rows);
                   catch(ArrayIndexOutOfBoundsException e)
                        System.out.println("The error in the row index " + rows);
                   fireTableDataChanged() ;
    class MyObj
              String first;
              String last;
              String third;
              String fourth;
              public MyObj( String f, String l, String t, String fo )
                   this.first = f;
                   this.last = l;
                   this.third = t;
                   this.fourth = fo;
    #####################################

    The following code works fine but it doesn't show me the new updated date in my JTable. I tried to print the values that I am getting and it does give the values on the prompt but doesn't show me on the JTable only first two are shown and the rest of the table is filled with the same values. I don't know what's going on and am tired of this TableModel thing so pla. take a time to give me some suggestions. Thanks
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    import java.io.*;
    import java.text.SimpleDateFormat;
    import java.util.*;
    public class SimpleTable extends JPanel {
         /** Formats the date */
         protected SimpleDateFormat           formatter;
    /** two-dimensional array to hold the information for each column */
    protected Object                     data[][];
    /** variable to hold the date and time in a raw form for the directory*/
    protected long                          dateDirectory;
    /** holds the readable form converted date for the directories*/
    protected String                     dirDate;
    /** holds the readable form converted date for the files*/
    protected String                     fileDate;
    /** variable to hold the date and time in a raw form for the file*/
    protected long                          dateFile;
    /** holds the length of the file in bytes */
    protected long                         totalLen;
    /** convert the length to the wrapper class */
    protected Long                         longe;
    /** Vector to hold the sub directories */
    protected Vector                     subDir;
    /** holds the name of the selected directory */
    protected String                    dirNameHold;
    /** converting vector to an Array and store the values in this */
    protected File                     directoryArray[];
    /** hashtable to store the key-value pair */
    protected static Hashtable hashTable = new Hashtable();
    /** refer to the TableModel that is the default*/
    protected DefaultTableModel      model;
    /** stores the path of the selected file */
    protected static String               fullPath;
    /** stores the currently selected file */
    protected static File selectedFilename;
    /** stores the extension of the selected file */
    protected static String           extension;
    protected Vector                     m = new Vector(0,1);
    /** holds the names of the columns */
    protected final String columnNames[] = {"Name", "Size", "Type", "Modified"};
    public SimpleTable(File directoryArray[])
              this.setLayout(new BorderLayout());
              this.setBorder( BorderFactory.createEmptyBorder( 0, 0, 0, 0 ) );
              (SimpleTable.hashTable).clear();
              data = new Object[this.getRowTotal(directoryArray)][this.getColumnTotal()];
              formatter = new SimpleDateFormat("mm/dd/yyyy hh:mm aaa");
              for(int k = 0; k < directoryArray.length; k++)
                   if(directoryArray[k].isDirectory())
                        data[k][0] = directoryArray[k].getName();
                        data[k][2] = "File Folder";
                        dateDirectory = directoryArray[k].lastModified();
                        dirDate = formatter.format(new java.util.Date(dateDirectory));
                        data[k][3] = dirDate;
                        (SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);                    
                   else if(directoryArray[k].isFile())
                        data[k][0] = directoryArray[k].getName();
                        totalLen = directoryArray[k].length();
                        longe = new Long(totalLen);
                        data[k][1] = longe + " Bytes";
                        dateFile = directoryArray[k].lastModified();
                        fileDate = formatter.format(new java.util.Date(dateFile));
                        data[k][3] = fileDate;
                        (SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);
    model = new DefaultTableModel();
    model.addTableModelListener( new TableModelListener(){
              public void tableChanged( javax.swing.event.TableModelEvent e )
                   System.out.println("************ I am inside the table changed method ********" );
              final JTable table = new JTable(model);
              table.getTableHeader().setReorderingAllowed(false);
              table.setRowSelectionAllowed(false);
              table.setBorder( BorderFactory.createEmptyBorder( 0, 0, 0, 0 ) );
              table.setShowHorizontalLines(false);
              table.setShowVerticalLines(false);
              table.addMouseListener(new MouseAdapter()
    /* public void mousePressed(MouseEvent e)
    //System.out.println("The clicked component is " + table.rowAtPoint(e.getPoint()) + "AND the number of clicks is " + e.getClickCount());
    /* if(e.getClickCount() >= 2 &&
    (table.getSelectedColumn() == 0) &&
    ((table.getColumnName(0)).equals(columnNames[0])))
         //System.out.println("The clicked component is " + table.rowAtPoint(e.getPoint()) + "AND the number of clicks is " + e.getClickCount());
         upDateTable(table);
    public void mouseReleased(MouseEvent e)
    //System.out.println("The clicked component is " + table.rowAtPoint(e.getPoint()) + "AND the number of clicks is " + e.getClickCount());
    /* if(e.getClickCount() >= 2 &&
    (table.getSelectedColumn() == 0) &&
    ((table.getColumnName(0)).equals(columnNames[0]))) */
         //System.out.println("The clicked component is " + table.rowAtPoint(e.getPoint()) + "AND the number of clicks is " + e.getClickCount());
         upDateTable(table);
              /** set the columns */
              for(int c = 0; c < columnNames.length; c++)
                   model.addColumn(columnNames[c]);
              /** set the rows */
              for(int r = 0; r < data.length; r++)
                   model.addRow(data[r]);
              DefaultTableCellRenderer D_headerRenderer = (DefaultTableCellRenderer ) table.getTableHeader().getDefaultRenderer();
              table.getColumnModel().getColumn(0).setHeaderRenderer(D_headerRenderer );
              ((DefaultTableCellRenderer)D_headerRenderer).setToolTipText("File and Folder in the Current Folder");
    //Create the scroll pane and add the table to it.
    JScrollPane scrollPane = new JScrollPane(table);
    //Add the scroll pane to this window.
    this.add(scrollPane, BorderLayout.CENTER);
    * Returns the number of columns
    public int getColumnTotal()
         return columnNames.length;
    * Returns the number of rows
    public int getRowTotal(Object directoryArray[])
         return directoryArray.length;
    private void upDateTable(JTable table)
    if((table.getSelectedColumn() == 0) && ((table.getColumnName(0)).equals(columnNames[0])))
         dirNameHold =(String) table.getValueAt(table.getSelectedRow(),table.getSelectedColumn());
                   File argument = findPath(dirNameHold);
                   if(argument.isFile())
                        CMRDialog.fileNameTextField.setText(argument.getName());
                        try
                             fullPath = argument.getCanonicalPath();                          
                             selectedFilename = argument.getCanonicalFile();                          
    CMRDialog.filtersComboBox.removeAllItems();
                             extension = fullPath.substring(fullPath.lastIndexOf('.'));
                             CMRDialog.filtersComboBox.addItem("( " + extension + " )" + " File");
                        catch(IOException e)
                             System.out.println("THE ERROR IS " + e);
                        return;
                   else if(argument.isDirectory())
                        String path = argument.getName();
                             //find the system dependent file separator
                             //String fileSeparator = System.getProperty("file.separator");
                        CMRDialog.driveComboBox.addItem(" " + path);
              subDir = Search.subDirs(argument);
              /**TBD:- needs a method to convert the vector to an array and return the array */
              directoryArray = new File[subDir.size()];
                   int indexCount = 0;
                   /** TBD:- This is inefficient way of converting a vector to an array */               
                   Iterator e = subDir.iterator();               
                   while( e.hasNext() )
                        directoryArray[indexCount] = (File)e.next();
                        indexCount++;
              /** now calls this method and clears the previous data */
              clearTableData(table);     
                   (SimpleTable.hashTable).clear();
                   data = new Object[this.getRowTotal(directoryArray)][this.getColumnTotal()];
                   formatter = new SimpleDateFormat("mm/dd/yyyy hh:mm aaa");
                   m.clear();
                   data = null;
                   data = new Object[this.getRowTotal(directoryArray)][this.getColumnTotal()];
                   for(int k = 0; k < directoryArray.length; k++)
                        if(directoryArray[k].isDirectory())
                        System.out.println("Inside the if part");
                             data[k][0] = directoryArray[k].getName();
                             table.setValueAt(directoryArray[k].getName(),k,0);
                             //model.fireTableCellUpdated(k,0);
                             data[k][2] = "File Folder";
                             table.setValueAt("File Folder",k,2);
                             //model.fireTableCellUpdated(k,2);
                             dateDirectory = directoryArray[k].lastModified();
                             dirDate = formatter.format(new java.util.Date(dateDirectory));
                             data[k][3] = dirDate;
                             table.setValueAt(dirDate,k,3);
                             //model.fireTableCellUpdated(k,3);
                             (SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);
                             m.add(data);
                             model.addRow(m);
                             model.fireTableDataChanged();                              
                        else if(directoryArray[k].isFile())
                   System.out.println("******* Inside the else part *******");
                             data[k][0] = directoryArray[k].getName();
                   System.out.println("The Name is == " + data[k][0]);
                             table.setValueAt(directoryArray[k].getName(),k,0);
                   System.out.println("The table cell value of the name is == " + table.getValueAt(k,0));
                             //model.fireTableCellUpdated(k,0);
                             totalLen = directoryArray[k].length();
                             longe = new Long(totalLen);
                             data[k][1] = longe + " Bytes";
                   System.out.println("The length == " + data[k][1]);
                             table.setValueAt(longe + " Bytes",k,1);
                   System.out.println("The table cell value of the length is == " + table.getValueAt(k,1));
                             //model.fireTableCellUpdated(k,0);
                             dateFile = directoryArray[k].lastModified();
                             fileDate = formatter.format(new java.util.Date(dateFile));
                             data[k][3] = fileDate;
                   System.out.println("The modified date == " + data[k][3]);
                             table.setValueAt(fileDate,k,3);
                   System.out.println("The table cell value of the name is == " + table.getValueAt(k,3));
                             //model.fireTableCellUpdated(k,0);
                             (SimpleTable.hashTable).put(directoryArray[k].getName(), directoryArray[k]);                    }
                             m.add(data);
                             model.addRow(m);
                             model.fireTableDataChanged();     
              // model.fireTableDataChanged();          
              // model.fireTableRowsInserted(0,1);
              table.revalidate();
              table.validate();               
         else
    * Searches the Hashtable and returns the path of the folder or the value.
    public File findPath(String value)
         return (File)((SimpleTable.hashTable).get(value));
    * This clears the previous data in the JTable
    public void clearTableData(JTable table)
         for(int row = 0; row < table.getRowCount() ; row++)
                   for (int col = 0; col < table.getColumnCount() ; col++)
                        table.setValueAt(null, row , col);
              model.fireTableStructureChanged();
    ###

  • SQL tuning or a simple comprise between time and cost?

    Hi,
    What I understand is that SQL tuning is a simple comprise between time and cost. Objectives of SQL tuning include:
    Reduce Cost
    Reduce Time
    Better Results
    Is it right and correct?
    Adith

    NO, WRONG.
    reducing COST is meaningless, because COST is meaningless. It's used internally by the optimizer to weigh the cost/benefits of different execution plans (access methods) for a single query. cost CANNOT be compared across queries. and if you add a hint to a sql, then it becomes a different sql (proven by looking in v$sql) so you cannot compare costs. in fact, when you provide a hint, oracle artificially lowers the cost associated with the hinted action in order to make that action look better to the optimizer, helping it to be choosen.
    reduce time. reduce io. reduce memory usage. that's it.

  • Gl balances and cost center

    Hi all,
    Is there any transaction code to see total balance of a particular GL and total of a particular cost centers totals in a single scree...?
    thanks you all

    Follow below given steps.
    1 Tcode - FAGLB03
    2. Go to line item display by clicking on cumulative balance field
    3. In layout select cost center field
    4. Sort the data by cost center field
    5. Take subtotal on the basis of cost center field
    6. On the left side of the screen where there is subtotal you will find it marked in yellow with single star
    7. Where the grand total of GL is there it is marked with two stars....
    8. Click on the two star row and there you will find subtotal of amount costcenter wise with grand total of GL

Maybe you are looking for