Index not getting used in the query(Query performance improvement)

Hi,
I am using oracle 10g version and have this query:
select distinct bk.name             "Book Name",
                fs.feed_description "Feed Name",
                fbs.cob_date        "Cob",
                at.description      "Data Type",
                ah.user_name        " User",
                ah.comments         "Comments",
                ah.time_draft
  from Action_type       at,
       action_history    ah,
       sensitivity_audit sa,
       logical_entity    le,
       feed_static       fs,
       feed_book_status  fbs,
       feed_instance     fi,
       marsnode          bk
where at.description = 'Regress Positions'
   and fbs.cob_date BETWEEN '01 Feb 2011' AND '08 Feb 2011'
   and fi.most_recent = 'Y'
   and bk.close_date is null
   and ah.time_draft = 'after'
   and sa.close_action_id is null
   and le.close_action_id is null
   and at.action_type_id = ah.action_type_id
   and ah.action_id = sa.create_action_id
   and le.logical_entity_id = sa.type_id
   and sa.feed_id = fs.feed_id
   and sa.book_id = bk.node_id
   and sa.feed_instance_id = fi.feed_instance_id
   and fbs.feed_instance_id = fi.feed_instance_id
   and fi.feed_id = fs.feed_id
union
select distinct bk.name             "Book Name",
                fs.feed_description "Feed Name",
                fbs.cob_date        "Cob",
                at.description      "Data Type",
                ah.user_name        " User",
                ah.comments         "Comments",
                ah.time_draft
  from feed_book_status         fbs,
       marsnode                 bk,
       feed_instance            fi,
       feed_static              fs,
       feed_book_status_history fbsh,
       Action_type              at,
       Action_history           ah
where fbs.cob_date BETWEEN '01 Feb 2011' AND '08 Feb 2011'
   and ah.action_type_id = 103
   and bk.close_date is null
   and ah.time_draft = 'after'
--   and ah.action_id = fbs.action_id
   and fbs.book_id = bk.node_id
   and fbs.book_id = fbsh.book_id
   and fbs.feed_instance_id = fi.feed_instance_id
   and fi.feed_id = fs.feed_id
   and fbsh.create_action_id = ah.action_id
   and at.action_type_id = ah.action_type_id
union
select distinct bk.name             "Book Name",
                fs.feed_description "Feed Name",
                fbs.cob_date        "Cob",
                at.description      "Data Type",
                ah.user_name        " User",
                ah.comments         "Comments",
                ah.time_draft
  from feed_book_status         fbs,
       marsnode                 bk,
       feed_instance            fi,
       feed_static              fs,
       feed_book_status_history fbsh,
       Action_type              at,
       Action_history           ah
where fbs.cob_date BETWEEN '01 Feb 2011' AND '08 Feb 2011'
   and ah.action_type_id = 101
   and bk.close_date is null
   and ah.time_draft = 'after'
   and fbs.book_id = bk.node_id
   and fbs.book_id = fbsh.book_id
   and fbs.feed_instance_id = fi.feed_instance_id
   and fi.feed_id = fs.feed_id
   and fbsh.create_action_id = ah.action_id
   and at.action_type_id = ah.action_type_id;This is the execution plan
| Id  | Operation                            | Name                     | Rows  | Bytes | Cost (%CPU)|
|   0 | SELECT STATEMENT                     |                          |   231 | 43267 |   104K (85)|
|   1 |  SORT UNIQUE                         |                          |   231 | 43267 |   104K (85)|
|   2 |   UNION-ALL                          |                          |       |       |            |
|   3 |    NESTED LOOPS                      |                          |     1 |   257 | 19540  (17)|
|   4 |     NESTED LOOPS                     |                          |     1 |   230 | 19539  (17)|
|   5 |      NESTED LOOPS                    |                          |     1 |   193 | 19537  (17)|
|   6 |       NESTED LOOPS                   |                          |     1 |   152 | 19534  (17)|
|*  7 |        HASH JOIN                     |                          |   213 | 26625 | 19530  (17)|
|*  8 |         TABLE ACCESS FULL            | LOGICAL_ENTITY           |    12 |   264 |     2   (0)|
|*  9 |         HASH JOIN                    |                          |  4267 |   429K| 19527  (17)|
|* 10 |          HASH JOIN                   |                          |  3602 | 90050 |  1268  (28)|
|* 11 |           INDEX RANGE SCAN           | IDX_FBS_CD_FII_BI        |  3602 | 46826 |    22   (5)|
|* 12 |           TABLE ACCESS FULL          | FEED_INSTANCE            |   335K|  3927K|  1217  (27)|
|* 13 |          TABLE ACCESS FULL           | SENSITIVITY_AUDIT        |   263K|    19M| 18236  (17)|
|  14 |        TABLE ACCESS BY INDEX ROWID   | FEED_STATIC              |     1 |    27 |     1   (0)|
|* 15 |         INDEX UNIQUE SCAN            | IDX_FEED_STATIC_FI       |     1 |       |     0   (0)|
|* 16 |       TABLE ACCESS BY INDEX ROWID    | MARSNODE                 |     1 |    41 |     3   (0)|
|* 17 |        INDEX RANGE SCAN              | PK_MARSNODE              |     3 |       |     2   (0)|
|* 18 |      TABLE ACCESS BY INDEX ROWID     | ACTION_HISTORY           |     1 |    37 |     2   (0)|
|* 19 |       INDEX UNIQUE SCAN              | PK_ACTION_HISTORY        |     1 |       |     1   (0)|
|* 20 |     TABLE ACCESS BY INDEX ROWID      | ACTION_TYPE              |     1 |    27 |     1   (0)|
|* 21 |      INDEX UNIQUE SCAN               | PK_ACTION_TYPE           |     1 |       |     0   (0)|
|* 22 |    TABLE ACCESS BY INDEX ROWID       | MARSNODE                 |     1 |    41 |     3   (0)|
|  23 |     NESTED LOOPS                     |                          |   115 | 21505 | 42367  (28)|
|* 24 |      HASH JOIN                       |                          |   114 | 16644 | 42023  (28)|
|  25 |       NESTED LOOPS                   |                          |   114 | 13566 | 42007  (28)|
|* 26 |        HASH JOIN                     |                          |   114 | 12426 | 41777  (28)|
|* 27 |         HASH JOIN                    |                          |   957 | 83259 | 41754  (28)|
|* 28 |          TABLE ACCESS FULL           | ACTION_HISTORY           |  2480 | 91760 | 30731  (28)|
|  29 |          NESTED LOOPS                |                          |  9570K|   456M| 10234  (21)|
|  30 |           TABLE ACCESS BY INDEX ROWID| ACTION_TYPE              |     1 |    27 |     1   (0)|
|* 31 |            INDEX UNIQUE SCAN         | PK_ACTION_TYPE           |     1 |       |     0   (0)|
|  32 |           TABLE ACCESS FULL          | FEED_BOOK_STATUS_HISTORY |  9570K|   209M| 10233  (21)|
|* 33 |         INDEX RANGE SCAN             | IDX_FBS_CD_FII_BI        |  3602 | 79244 |    22   (5)|
|  34 |        TABLE ACCESS BY INDEX ROWID   | FEED_INSTANCE            |     1 |    10 |     2   (0)|
|* 35 |         INDEX UNIQUE SCAN            | PK_FEED_INSTANCE         |     1 |       |     1   (0)|
|  36 |       TABLE ACCESS FULL              | FEED_STATIC              |  2899 | 78273 |    16   (7)|
|* 37 |      INDEX RANGE SCAN                | PK_MARSNODE              |     1 |       |     2   (0)|
|* 38 |    TABLE ACCESS BY INDEX ROWID       | MARSNODE                 |     1 |    41 |     3   (0)|
|  39 |     NESTED LOOPS                     |                          |   115 | 21505 | 42367  (28)|
|* 40 |      HASH JOIN                       |                          |   114 | 16644 | 42023  (28)|
|  41 |       NESTED LOOPS                   |                          |   114 | 13566 | 42007  (28)|
|* 42 |        HASH JOIN                     |                          |   114 | 12426 | 41777  (28)|
|* 43 |         HASH JOIN                    |                          |   957 | 83259 | 41754  (28)|
|* 44 |          TABLE ACCESS FULL           | ACTION_HISTORY           |  2480 | 91760 | 30731  (28)|
|  45 |          NESTED LOOPS                |                          |  9570K|   456M| 10234  (21)|
|  46 |           TABLE ACCESS BY INDEX ROWID| ACTION_TYPE              |     1 |    27 |     1   (0)|
|* 47 |            INDEX UNIQUE SCAN         | PK_ACTION_TYPE           |     1 |       |     0   (0)|
|  48 |           TABLE ACCESS FULL          | FEED_BOOK_STATUS_HISTORY |  9570K|   209M| 10233  (21)|
|* 49 |         INDEX RANGE SCAN             | IDX_FBS_CD_FII_BI        |  3602 | 79244 |    22   (5)|
|  50 |        TABLE ACCESS BY INDEX ROWID   | FEED_INSTANCE            |     1 |    10 |     2   (0)|
|* 51 |         INDEX UNIQUE SCAN            | PK_FEED_INSTANCE         |     1 |       |     1   (0)|
|  52 |       TABLE ACCESS FULL              | FEED_STATIC              |  2899 | 78273 |    16   (7)|
|* 53 |      INDEX RANGE SCAN                | PK_MARSNODE              |     1 |       |     2   (0)|
------------------------------------------------------------------------------------------------------and the predicate info
Predicate Information (identified by operation id):
   7 - access("LE"."LOGICAL_ENTITY_ID"="SA"."TYPE_ID")
   8 - filter("LE"."CLOSE_ACTION_ID" IS NULL)
   9 - access("SA"."FEED_INSTANCE_ID"="FI"."FEED_INSTANCE_ID")
  10 - access("FBS"."FEED_INSTANCE_ID"="FI"."FEED_INSTANCE_ID")
  11 - access("FBS"."COB_DATE">=TO_DATE(' 2011-02-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
              "FBS"."COB_DATE"<=TO_DATE(' 2011-02-08 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
  12 - filter("FI"."MOST_RECENT"='Y')
  13 - filter("SA"."CLOSE_ACTION_ID" IS NULL)
  15 - access("FI"."FEED_ID"="FS"."FEED_ID")
       filter("SA"."FEED_ID"="FS"."FEED_ID")
  16 - filter("BK"."CLOSE_DATE" IS NULL)
  17 - access("SA"."BOOK_ID"="BK"."NODE_ID")
  18 - filter("AH"."TIME_DRAFT"='after')
  19 - access("AH"."ACTION_ID"="SA"."CREATE_ACTION_ID")
  20 - filter("AT"."DESCRIPTION"='Regress Positions')
  21 - access("AT"."ACTION_TYPE_ID"="AH"."ACTION_TYPE_ID")
  22 - filter("BK"."CLOSE_DATE" IS NULL)
  24 - access("FI"."FEED_ID"="FS"."FEED_ID")
  26 - access("FBS"."BOOK_ID"="FBSH"."BOOK_ID")
  27 - access("FBSH"."CREATE_ACTION_ID"="AH"."ACTION_ID" AND
              "AT"."ACTION_TYPE_ID"="AH"."ACTION_TYPE_ID")
  28 - filter("AH"."ACTION_TYPE_ID"=103 AND "AH"."TIME_DRAFT"='after')
  31 - access("AT"."ACTION_TYPE_ID"=103)
  33 - access("FBS"."COB_DATE">=TO_DATE(' 2011-02-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
              "FBS"."COB_DATE"<=TO_DATE(' 2011-02-08 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
  35 - access("FBS"."FEED_INSTANCE_ID"="FI"."FEED_INSTANCE_ID")
  37 - access("FBS"."BOOK_ID"="BK"."NODE_ID")
  38 - filter("BK"."CLOSE_DATE" IS NULL)
  40 - access("FI"."FEED_ID"="FS"."FEED_ID")
  42 - access("FBS"."BOOK_ID"="FBSH"."BOOK_ID")
  43 - access("FBSH"."CREATE_ACTION_ID"="AH"."ACTION_ID" AND
              "AT"."ACTION_TYPE_ID"="AH"."ACTION_TYPE_ID")
  44 - filter("AH"."ACTION_TYPE_ID"=101 AND "AH"."TIME_DRAFT"='after')
  47 - access("AT"."ACTION_TYPE_ID"=101)
  49 - access("FBS"."COB_DATE">=TO_DATE(' 2011-02-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
              "FBS"."COB_DATE"<=TO_DATE(' 2011-02-08 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
  51 - access("FBS"."FEED_INSTANCE_ID"="FI"."FEED_INSTANCE_ID")
  53 - access("FBS"."BOOK_ID"="BK"."NODE_ID")
Note
   - 'PLAN_TABLE' is old versionIn this query, mainly the ACTION_HISTORY and FEED_BOOK_STATUS_HISTORY tables are getting accessed fullly though there are indexes createdon them like this
ACTION_HISTORY
ACTION_ID  column Unique index
FEED_BOOK_STATUS_HISTORY
(FEED_INSTANCE_ID, BOOK_ID, COB_DATE, VERSION) composite indexI tried all the best combinations however the indexes are not getting used anywhere.
Could you please suggest some way so the query will perform better way.
Thanks,
Aashish

Hi Mohammed,
This is what I got after your method of execution plan
SQL_ID  4vmc8rzgaqgka, child number 0
select distinct bk.name "Book Name" ,       fs.feed_description "Feed Name" ,       fbs.cob_date
"Cob" ,       at.description "Data Type" ,       ah.user_name " User" ,       ah.comments "Comments"
,       ah.time_draft from Action_type at, action_history  ah, sensitivity_audit sa, logical_entity
le, feed_static fs, feed_book_status fbs, feed_instance fi, marsnode bk where  at.description =
'Regress Positions' and    fbs.cob_date BETWEEN '01 Feb 2011' AND '08 Feb 2011' and
fi.most_recent = 'Y' and    bk.close_date is  null and    ah.time_draft='after' and
sa.close_action_id is null and    le.close_action_id is null and    at.action_type_id =
ah.action_type_id and    ah.action_id=sa.create_action_id and    le.logical_entity_id = sa.type_id
and    sa.feed_id = fs.feed_id and    sa.book_id = bk.node_id and    sa.feed_instance_id =
fi.feed_instance_id and    fbs.feed_instance_id = fi.feed_instance_id and    fi.feed_id = fs.feed_id
union select distinct bk.name "Book Name" ,       fs.
Plan hash value: 1006571916
| Id  | Operation                            | Name                     | E-Rows |  OMem |  1Mem | Used-Mem |
|   1 |  SORT UNIQUE                         |                          |    231 |  6144 |  6144 | 6144  (0)|
|   2 |   UNION-ALL                          |                          |        |       |       |          |
|   3 |    NESTED LOOPS                      |                          |      1 |       |       |          |
|   4 |     NESTED LOOPS                     |                          |      1 |       |       |          |
|   5 |      NESTED LOOPS                    |                          |      1 |       |       |          |
|   6 |       NESTED LOOPS                   |                          |      1 |       |       |          |
|*  7 |        HASH JOIN                     |                          |    213 |  1236K|  1236K| 1201K (0)|
|*  8 |         TABLE ACCESS FULL            | LOGICAL_ENTITY           |     12 |       |       |          |
|*  9 |         HASH JOIN                    |                          |   4267 |  1023K|  1023K| 1274K (0)|
|* 10 |          HASH JOIN                   |                          |   3602 |  1095K|  1095K| 1296K (0)|
|* 11 |           INDEX RANGE SCAN           | IDX_FBS_CD_FII_BI        |   3602 |       |       |          |
|* 12 |           TABLE ACCESS FULL          | FEED_INSTANCE            |    335K|       |       |          |
|* 13 |          TABLE ACCESS FULL           | SENSITIVITY_AUDIT        |    263K|       |       |          |
|  14 |        TABLE ACCESS BY INDEX ROWID   | FEED_STATIC              |      1 |       |       |          |
|* 15 |         INDEX UNIQUE SCAN            | IDX_FEED_STATIC_FI       |      1 |       |       |          |
|* 16 |       TABLE ACCESS BY INDEX ROWID    | MARSNODE                 |      1 |       |       |          |
|* 17 |        INDEX RANGE SCAN              | PK_MARSNODE              |      3 |       |       |          |
|* 18 |      TABLE ACCESS BY INDEX ROWID     | ACTION_HISTORY           |      1 |       |       |          |
|* 19 |       INDEX UNIQUE SCAN              | PK_ACTION_HISTORY        |      1 |       |       |          |
|* 20 |     TABLE ACCESS BY INDEX ROWID      | ACTION_TYPE              |      1 |       |       |          |
|* 21 |      INDEX UNIQUE SCAN               | PK_ACTION_TYPE           |      1 |       |       |          |
|* 22 |    TABLE ACCESS BY INDEX ROWID       | MARSNODE                 |      1 |       |       |          |
|  23 |     NESTED LOOPS                     |                          |    115 |       |       |          |
|* 24 |      HASH JOIN                       |                          |    114 |   809K|   809K|  817K (0)|
|  25 |       NESTED LOOPS                   |                          |    114 |       |       |          |
|* 26 |        HASH JOIN                     |                          |    114 |   868K|   868K| 1234K (0)|
|* 27 |         HASH JOIN                    |                          |    957 |   933K|   933K| 1232K (0)|
|* 28 |          TABLE ACCESS FULL           | ACTION_HISTORY           |   2480 |       |       |          |
|  29 |          NESTED LOOPS                |                          |   9570K|       |       |          |
|  30 |           TABLE ACCESS BY INDEX ROWID| ACTION_TYPE              |      1 |       |       |          |
|* 31 |            INDEX UNIQUE SCAN         | PK_ACTION_TYPE           |      1 |       |       |          |
|  32 |           TABLE ACCESS FULL          | FEED_BOOK_STATUS_HISTORY |   9570K|       |       |          |
|* 33 |         INDEX RANGE SCAN             | IDX_FBS_CD_FII_BI        |   3602 |       |       |          |
|  34 |        TABLE ACCESS BY INDEX ROWID   | FEED_INSTANCE            |      1 |       |       |          |
|* 35 |         INDEX UNIQUE SCAN            | PK_FEED_INSTANCE         |      1 |       |       |          |
|  36 |       TABLE ACCESS FULL              | FEED_STATIC              |   2899 |       |       |          |
|* 37 |      INDEX RANGE SCAN                | PK_MARSNODE              |      1 |       |       |          |
|* 38 |    TABLE ACCESS BY INDEX ROWID       | MARSNODE                 |      1 |       |       |          |
|  39 |     NESTED LOOPS                     |                          |    115 |       |       |          |
|* 40 |      HASH JOIN                       |                          |    114 |   743K|   743K|  149K (0)|
|  41 |       NESTED LOOPS                   |                          |    114 |       |       |          |
|* 42 |        HASH JOIN                     |                          |    114 |   766K|   766K|  208K (0)|
|* 43 |         HASH JOIN                    |                          |    957 |   842K|   842K|  204K (0)|
|* 44 |          TABLE ACCESS FULL           | ACTION_HISTORY           |   2480 |       |       |          |
|  45 |          NESTED LOOPS                |                          |   9570K|       |       |          |
|  46 |           TABLE ACCESS BY INDEX ROWID| ACTION_TYPE              |      1 |       |       |          |
|* 47 |            INDEX UNIQUE SCAN         | PK_ACTION_TYPE           |      1 |       |       |          |
|  48 |           TABLE ACCESS FULL          | FEED_BOOK_STATUS_HISTORY |   9570K|       |       |          |
|* 49 |         INDEX RANGE SCAN             | IDX_FBS_CD_FII_BI        |   3602 |       |       |          |
|  50 |        TABLE ACCESS BY INDEX ROWID   | FEED_INSTANCE            |      1 |       |       |          |
|* 51 |         INDEX UNIQUE SCAN            | PK_FEED_INSTANCE         |      1 |       |       |          |
|  52 |       TABLE ACCESS FULL              | FEED_STATIC              |   2899 |       |       |          |
|* 53 |      INDEX RANGE SCAN                | PK_MARSNODE              |      1 |       |       |          |
Predicate Information (identified by operation id):
   7 - access("LE"."LOGICAL_ENTITY_ID"="SA"."TYPE_ID")
   8 - filter("LE"."CLOSE_ACTION_ID" IS NULL)
   9 - access("SA"."FEED_INSTANCE_ID"="FI"."FEED_INSTANCE_ID")
  10 - access("FBS"."FEED_INSTANCE_ID"="FI"."FEED_INSTANCE_ID")
  11 - access("FBS"."COB_DATE">=TO_DATE(' 2011-02-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
              "FBS"."COB_DATE"<=TO_DATE(' 2011-02-08 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
  12 - filter("FI"."MOST_RECENT"='Y')
  13 - filter("SA"."CLOSE_ACTION_ID" IS NULL)
  15 - access("FI"."FEED_ID"="FS"."FEED_ID")
       filter("SA"."FEED_ID"="FS"."FEED_ID")
  16 - filter("BK"."CLOSE_DATE" IS NULL)
  17 - access("SA"."BOOK_ID"="BK"."NODE_ID")
  18 - filter("AH"."TIME_DRAFT"='after')
  19 - access("AH"."ACTION_ID"="SA"."CREATE_ACTION_ID")
  20 - filter("AT"."DESCRIPTION"='Regress Positions')
  21 - access("AT"."ACTION_TYPE_ID"="AH"."ACTION_TYPE_ID")
  22 - filter("BK"."CLOSE_DATE" IS NULL)
  24 - access("FI"."FEED_ID"="FS"."FEED_ID")
  26 - access("FBS"."BOOK_ID"="FBSH"."BOOK_ID")
  27 - access("FBSH"."CREATE_ACTION_ID"="AH"."ACTION_ID" AND
              "AT"."ACTION_TYPE_ID"="AH"."ACTION_TYPE_ID")
  28 - filter(("AH"."ACTION_TYPE_ID"=103 AND "AH"."TIME_DRAFT"='after'))
  31 - access("AT"."ACTION_TYPE_ID"=103)
  33 - access("FBS"."COB_DATE">=TO_DATE(' 2011-02-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
              "FBS"."COB_DATE"<=TO_DATE(' 2011-02-08 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
  35 - access("FBS"."FEED_INSTANCE_ID"="FI"."FEED_INSTANCE_ID")
  37 - access("FBS"."BOOK_ID"="BK"."NODE_ID")
  38 - filter("BK"."CLOSE_DATE" IS NULL)
  40 - access("FI"."FEED_ID"="FS"."FEED_ID")
  42 - access("FBS"."BOOK_ID"="FBSH"."BOOK_ID")
  43 - access("FBSH"."CREATE_ACTION_ID"="AH"."ACTION_ID" AND
              "AT"."ACTION_TYPE_ID"="AH"."ACTION_TYPE_ID")
  44 - filter(("AH"."ACTION_TYPE_ID"=101 AND "AH"."TIME_DRAFT"='after'))
  47 - access("AT"."ACTION_TYPE_ID"=101)
  49 - access("FBS"."COB_DATE">=TO_DATE(' 2011-02-01 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
              "FBS"."COB_DATE"<=TO_DATE(' 2011-02-08 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
  51 - access("FBS"."FEED_INSTANCE_ID"="FI"."FEED_INSTANCE_ID")
  53 - access("FBS"."BOOK_ID"="BK"."NODE_ID")
Note
   - Warning: basic plan statistics not available. These are only collected when:
       * hint 'gather_plan_statistics' is used for the statement or
       * parameter 'statistics_level' is set to 'ALL', at session or system level
122 rows selected.
Elapsed: 00:00:02.18The action_type_id column is of NUMBER type.

Similar Messages

  • Index not getting used in spite of hints

    Its Oracle 10g Release 10.2.0.4.0 Hi All,
    I have this query in which there is are indexes on Intrument table like this:
    Instrument:
    idx 1 : (INSTRUMENT_ID, END_COB_DATE, CLOSE_ACTION_ID, PRODUCT_SUB_TYPE_ID, BEGIN_COB_DATE)
    idx 2 : ( INSTRUMENT_ID, INSTRUMENT_VN, END_COB_DATE, CLOSE_ACTION_ID)
    idx 3 : (CLOSE_ACTION_ID, END_COB_DATE)I tried all the possible ways but none of the indexes are getting used causing full table scans of this table. I need some guidance on how can I avoid this FTS so the query can run fast and use the index on Instrument table:
    query:
    select distinct i.instrument_id,
                    i.name,
                    case
                      when (mn2.display_name != 'DEBT PRIORITY CLASS' and
                           mn2.display_name is not null) then
                       mn2.display_name
                      else
                       mn1.display_name
                    end "DEBT_PRIORITY_CLASS"
      from instrument i, inst_debt id
      left join marsnode mn1 on (id.debt_priority_class_id = mn1.node_id and
                                mn1.close_date is null and
                                mn1.type_id = 58412926883279)
      left join marsnodelink mnl1 on (mn1.node_id = mnl1.node_id and
                                     mnl1.close_date is null and
                                     mnl1.begin_cob_date <=
                                     TO_DATE('27-Oct-2010', 'DD-Mon-YYYY') and
                                     mnl1.end_cob_date >
                                     TO_DATE('27-Oct-2010', 'DD-Mon-YYYY'))
      left join marsnode mn2 on (mnl1.parent_id = mn2.node_id and
                                mn2.close_date is null and
                                mn2.type_id = 58412926883279)
    where i.instrument_id = id.instrument_id
       and i.instrument_vn = id.instrument_vn
       AND i.end_cob_date > TO_DATE('27-Oct-2010', 'DD-Mon-YYYY')
       AND i.close_action_id is null
       AND i.product_sub_type_id = 3
       AND i.begin_cob_date <= TO_DATE('27-Oct-2010', 'DD-Mon-YYYY')This is the execution plan
    | Id  | Operation                       | Name              | Rows  | Bytes |TempSpc| Cost (%CPU)|
    |   0 | SELECT STATEMENT                |                   |  2026K|   407M|       |   509K (20)|
    |   1 |  HASH UNIQUE                    |                   |  2026K|   407M|   879M|   509K (20)|
    |*  2 |   HASH JOIN RIGHT OUTER         |                   |  2026K|   407M|       |   426K (23)|
    |*  3 |    TABLE ACCESS BY INDEX ROWID  | MARSNODE          |   501 | 23046 |       |   239   (3)|
    |*  4 |     INDEX RANGE SCAN            | FKI_38576_TYPE_ID | 10159 |       |       |    34   (6)|
    |*  5 |    HASH JOIN RIGHT OUTER        |                   |  2026K|   318M|       |   425K (23)|
    |*  6 |     TABLE ACCESS FULL           | MARSNODELINK      |   330 | 15510 |       |  6560  (16)|
    |*  7 |     HASH JOIN RIGHT OUTER       |                   |  2026K|   228M|       |   419K (23)|
    |*  8 |      TABLE ACCESS BY INDEX ROWID| MARSNODE          |   501 | 23046 |       |   239   (3)|
    |*  9 |       INDEX RANGE SCAN          | FKI_38576_TYPE_ID | 10159 |       |       |    34   (6)|
    |* 10 |      HASH JOIN                  |                   |  2026K|   139M|    34M|   418K (23)|
    |  11 |       TABLE ACCESS FULL         | INST_DEBT         |  1031K|    22M|       |  1665  (30)|
    *|* 12 |       TABLE ACCESS FULL         | INSTRUMENT        |  2062K|    96M|       |   413K (23)|*
    --------------------------------------------------------------------------------------------------predicate info
    2 - access("MNL1"."PARENT_ID"="MN2"."NODE_ID"(+))
    3 - filter("MN2"."CLOSE_DATE"(+) IS NULL)
    4 - access("MN2"."TYPE_ID"(+)=58412926883279)
    5 - access("MN1"."NODE_ID"="MNL1"."NODE_ID"(+))
    6 - filter("MNL1"."CLOSE_DATE"(+) IS NULL AND "MNL1"."END_COB_DATE"(+)>TO_DATE('
                2010-10-27 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND "MNL1"."BEGIN_COB_DATE"(+)<=TO_DATE('
                2010-10-27 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
    7 - access("ID"."DEBT_PRIORITY_CLASS_ID"="MN1"."NODE_ID"(+))
    8 - filter("MN1"."CLOSE_DATE"(+) IS NULL)
    9 - access("MN1"."TYPE_ID"(+)=58412926883279)
    10 - access("I"."INSTRUMENT_ID"="ID"."INSTRUMENT_ID" AND
                "I"."INSTRUMENT_VN"="ID"."INSTRUMENT_VN")
    12 - filter("I"."PRODUCT_SUB_TYPE_ID"=3 AND "I"."CLOSE_ACTION_ID" IS NULL AND
                "I"."END_COB_DATE">TO_DATE(' 2010-10-27 00:00:00', 'syyyy-mm-dd hh24:mi:ss') AND
                "I"."BEGIN_COB_DATE"<=TO_DATE(' 2010-10-27 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))Regards,
    Aashish

    Aashish S. wrote:
    I tried all the possible ways but none of the indexes are getting used causing full table scans of this table. I need some guidance on how can I avoid this FTS so the query can run fast and use the index on Instrument table:I assume the last part of the above statement is what you actually need to achieve (i.e. improve execution time of the query) and the query not using index is what you think the "cause" for the actual "problem". I will try to answer the actual "problem". Based on what you have posted, some observations/suggestions
    1) Your plan shows the query is expected to retrieve 2026K rows. Are you sure you need to retrieve that many records? You may want to revisit the "requirement" here.
    2) Continuing above point, you may want to post details of how much time the query is taking to execute at present and how much time do you expect it to take. Another most important details will be how are you measuring the query execution time. With that huge number of records, it is quite possible that more time is being spent in just transferring the query results to the "client" than actual time taken by server to execute the query.
    3) If what you have posted is the order of columns in the indexes on INSTRUMENT table, then which index do you think will help the query execution and how? The order of columns suggest that none of the indexes will be good enough and that seems to be the right choice.
    4) Your predicate section states that filter predicate on INSTRUMENT table generates 2062K rows. How many records exist in INSTRUMENT table? You will need to have many times more records (besides other factors like ordering of table data etc.) in the table to justify the indexed access to fetch these huge number of rows.
    5) Finally, you may want to verify whether the statistics on tables and indexes used by the query are up-to-date.
    Hope this helps.

  • Indexes not getting used in schema having chinese data

    I have a database with chinese data in it. When i execute few queries in that schema it does not use the available indexes of that table. Query takes long time to execute and the temp tablespace gets full. But when i execute the same query in another schema having english data the query executes quickly and uses all the indexes.
    I tried gathering database statistics and rebuilding the indexes but that did not work out as well.
    Can any body tell me whether the index creation differs for foreign languages? Do i need to create the indexes differently then normally we create?
    why the indexes are not being used in the schema having chinese data?
    Edited by: user621442 on Dec 17, 2009 10:03 AM

    user621442 wrote:
    I have a database with chinese data in it. When i execute few queries in that schema it does not use the available indexes of that table. Query takes long time to execute and the temp tablespace gets full. But when i execute the same query in another schema having english data the query executes quickly and uses all the indexes.
    I tried gathering database statistics and rebuilding the indexes but that did not work out as well.
    Can any body tell me whether the index creation differs for foreign languages? Do i need to create the indexes differently then normally we create?
    why the indexes are not being used in the schema having chinese data?
    Edited by: user621442 on Dec 17, 2009 10:03 AMHi,
    I do not think so index would behave differently for different languages, yes sorting may behave in a diffierent way.
    Can you post the explain plan from both the database.
    And also nls_sort parameter from both the database.
    I believe that you have order by clause which is not able to sort using index.
    Regards
    Anurag

  • Index not getting used

    Hi,
    Oracle version 10g
    I have created a partitioned table and it has the below columns:
    The table is partitioned on the created_date.
    How data gets inserted into this table:
    we have a staging table which will get first populated and then using Exchange partitionis populated.
    statement which populates rel_table
    ' ALTER TABLE ' || table1 ||
    ' EXCHANGE PARTITION ' ||partitionname ||
    ' WITH TABLE ' || table2 ||
    ' WITH VALIDATION UPDATE GLOBAL INDEXES';
    after exchange partition the indexs gets rebuild
    The table would have millions of records.
    Now if i issue a query
    plz help...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    But the indexed column is used in the join, so the index should get used right?Not necessarily. How many rows are in the table? How many rows have that column > 0?
    Please read these:
    When your query takes too long
    When your query takes too long ...
    How to Post a SQL statement tuning request
    HOW TO: Post a SQL statement tuning request - template posting

  • Chart not getting columns from the SQL Query with InlineTransform(xsl)

    Hi All,
    I am using MII 12.0 . I tried to use the mii standard xsl for converting rows into columns by  Inline Transform in a SQL Query.
    while executing the Query it is giving me the correct output but i tried to load the same Query in a IChart there it is not showing me the available columns that i can able to see in simple executiion and chart is also not plotting it keeps on loading.
    Thanks in Advance.

    Hi LinoVaz,
    Some things to try for testing purposes -
    1. Don't do any Data Mapping of the query columns
    2. If a SQL Query, you may need to change the Server Scaling to use Global AutoScale.
    I found that when I mapped the inline-transformed query into a bar chart display template, and hit the Refresh button, only the first column name show in the Column Names area.  If I mapped it, I got only that column.  If I didn't map any columns, I got them all.
    Let me know if you find similar results.  I think this is likely a bug, so you may consider using a Business Logic Transaction and an XacuteQuery to accomplish the same result.
    Kind Regards,
    Diana Hoppe
    Edited by: Diana Hoppe on Mar 25, 2011 11:46 AM

  • Criteria item is not being used in the LOV query

    Hi All,
    I have one 'messageChoice' bean which is associated with a view
    I have configured it correctly
    I have one 'messageLOVInput' bean
    above 'mesaageChoice' acts as criteria item for 'messageLOVInput'
    I created two maps one for each beans
    When I select a value from 'messageChoice' and click LOV button
    now LOV window should query based on the value from choice..
    but its not at all taking choice selection in the query criteria...
    Where I am doing mistake..?
    Thnaks
    -Praveen

    Hi,
    we are gathering JDeveloper 11 technology preview related question in a separate forum
    JDeveloper and OC4J 11g Technology Preview
    Frank

  • How does Index fragmentation and statistics affect the sql query performance

    Hi,
    How does Index fragmentation and statistics affect the sql query performance
    Thanks
    Shashikala
    Shashikala

    How does Index fragmentation and statistics affect the sql query performance
    Very simple answer, outdated statistics will lead optimizer to create bad plans which in turn will require more resources and this will impact performance. If index is fragmented ( mainly clustered index,holds true for Non clustred as well) time spent in finding
    the value will be more as query would have to search fragmented index to look for data, additional spaces will increase search time.
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
    My TechNet Wiki Articles

  • Some of the songs I have downloaded onto i tunes won't play when I select it to do so.  The error message I get is "The song could not be used because the original file could not be found.  Would you like to locate it?"  How can I get my songs to play?

    Some of the songs I have downloaded into i tunes won't play when I select it to do so.  The error message I get is "The song can not be used because the original file can not be found.  Would you like to locate it?"  When I select yes I'm sent to a screen that has my i tunes library listed.  When I select the song in question I'm asked if I would like to open the song.  When I select this option I get nothing.  The songs I have downloaded must be somewhere because they are listed in my i tunes library and on the screen I've been sent to.  I can't the songs to play however.  This is not true of all of my songs but it is true of quite a few of them.  Actually, one song is too many.    How do I get my music to play that seems to be locked up somewhere in the computer?

    Presuming they're on your computer, right click on them and then follow the prompts to locate hte file on your computer.

  • On some of my files there is a ! in front of it, if I try to play the song, I get an error message; "The song "_____" could not be used, because the original file could not be found. Would you like to locate it?" Then when I click "Locate", I get nothing.

    I'm really dumbfounded on this one and it's driving me bonkers!!!! On some of my music files there is a ! in front of it, if I try to play the song, I get an error message; "The song "_____" could not be used, because the original file could not be found. Would you like to locate it?"
    This began to happen when Chuck made playlists2burn on2CD-and then he would delete the playlist; sending all the song files into oblivion. Certain songs have a ! right next to the file name, and as I stated before, i get that error message:
    "The song "_____" could not be used, because the original file could not be found. Would you like to locate it?"
    So I click on "Locate". No help. I get a menu with folders that say "catroot" and other folders which names I cannot remember, but I scroll PAST the file folders, & it's just a bunch of ".DLL" files.....I don't understand what any of the names of the folders mean...it's frustr8ing-coz this is my 2nd iTouch, my 1st one got stolen & I can't afford2buy my music back at this time & i NEVER before had a single problem with losing song file locations.
                  Is there anyone out there who has been through this frustrating game of chasing your tail?....<that's how I feel>
    If so I would be ever so gr8ful if maybe someone with the knowledge would be so kind as 2 tell me how/where 2 retrieve these songs & how to put everything back where it belongs, I would be 4ever gr8ful !!!
    I can't afford 2 replace the songs just like I'm unable 2 buy back my old music from my stolen iTouch....man that was an awesome collection-someday I'll be able 2 afford 2 do that & I would like 2 have all the new music that I paid 4 but cannot find when I got my new iTouch....that would just be  wonderful.
                 I hope someone sees this post that can help me retrieve these files....losing $100.00 of iTunes is a REAL BUMMER!!!!!!
                                                      ThanQ SO very much!
                                                                             [email protected] or [email protected] or [email protected] .
                                                                                               You can also find me on Facebook, my given name is Tiffinie Trimmer, &
                                                                                                that's my Facebook "handle".    ThanQ 4 taking the time 2 read all of this!
                                                                                                hope 2 get a reply someday....I'll B checking all my emails & my Facebook, as well
                                                                                                as marking this page in my FAVORITES so I can find it fast! Take Care!!!

    I was not complete clear.
    Since you never changed the settings in the advanced section of iTunes preferecnes, you have to chech that your music is really in the location setted in the folders reported in the advanced section.  If not you have 2 ways: reset the position of this folders or in the actual disk organisation or in the pointing on the preferences.
    If you press the reset button you just give to itunes its default setting as for the position of the music files: probably this will be a good choice if you have never changed any default preference.
    But before I would check the folders and see if the songs are really there
    In my iTune I have this, and I believe it is the default.
    Users/YOURHOMEFOLDERNAME/Music/iTunes/iTunes Music

  • Library Lost - Please HeIp I tried updating my old ipod & now all 10,000 songs in my library have an ! next to them and I get the error message "song " " could not be used because the original file could not be found" on every song I try to play

    Please help - this morning I tried updating one of my old ipods for my wife (this ipod hasn't been updated in 2-3 years).  I plugged it into my pc, it was recognized and the software updated.  I created a new playlist and tied to sync the ipod.  This ipod had never been used on this pc/itunes since the pc is only 2 years old.  When I tried to sync the ipod it stated that it would have to erase all the old songs on the ipod prior to syncing.  I clicked ok and it proceeded to wipe out the old ipod and sync the new playlist (~1000 songs).  When the sync was complete there were only 6 songs from the new playlist (all purchased this morning from itunes) on the ipod and to my horror all ~10,000 song on my pc in itunes now have a ! next to them.  Only my recent purchases from itunes do not.  When I click on a song with the ! I get the error message "the song " " could not be used because the original file could not be found."  How do I correct this issue - I am scared to hook my ipads or other ipods to my pc for fear of losing everything?!?!?  I spent 100s of hours burning the 10,000 songs from my cd collection and do not want to have to do it again. 
    Any help is greatly appreciated.

    This "original file cannot be found" thing happens if the file is no longer where iTunes expects to find it. Possible causes are that you or some third party tool has moved, renamed or deleted the file, or that the drive it lives on has had a change of drive letter. It is also possible that iTunes has changed from expecting the files to be in the pre-iTunes 9 layout to post-iTunes 9 layout,or vice-versa, and so is looking in slightly the wrong place.
    Select a track with an exclamation mark, use Ctrl-I to get info, then cancel when asked to try to locate the track. Look on the summary tab for the location that iTunes thinks the file should be. Now take a look around your hard drive(s). Hopefully you can locate the track in question. If a section of your library has simply been moved, or a drive letter has changed, it should be possible to reverse the actions.
    Alternatively, as long as you can find a location holding the missing files, then you should be able to use my FindTracks script to reconnect them to iTunes .
    tt2

  • I recently reset my computer and copy my music from an external hard drive to my itunes library.  When I click on a song to play i get an error message that says " the song could not be used because the original file could not be found".  need help

    I recently reset my computer and copy my music from an external hard drive to my itunes library.  When I click on a song to play i get an error message that says " the song could not be used because the original file could not be found".  But when I have my external hard drive plug in the song will play with no problem.  What do I need to do to play my music without having the external harddrive plug in ????????  Please help

    Because the location for each song in your library is on your hard drive.  If the hard drive isn't there, how can iTunes play it?
    You'll have to move/copy the music from your hard drive to your computer's hard drive.
    Basically, EASIEST way to do all this, if you don't care about your play counts, etc...
    -Delete EVERYTHING from iTunes, so that your library is now empty.
    -Go to "Advanced" inside of the "Preferences" window, found in the "Edit" drop-down.  You can also access Preferences by pressing Ctrl+, (Press Ctrl and the comma key)
    -Change your iTunes Media Folder Location to something simple, but on your computer. I use C:/iTunes.  Make sure "Keep iTunes Media Folder Organized" and "Copy files to...." are both checked.  You can close Preferences now.
    -Now, drag and drop your music from your hard drive into your iTunes library.  iTunes will automatically add the music to your library, as you would expect, and also creates a copy of each file to place into that iTunes Media Folder you just created.
    Shouldn't have any more problems...

  • I use more than one computer to access my four business email accounts. When one computer is on (and mail is open) emails do not get through to the other computers. This is fine, but how do I make one of the other computers the dominant one?

    I use more than one computer to access my four business email accounts. When one computer is on (and mail is open) emails do not get through to the other computers. This is fine, but how do I make one of the other computers the dominant one?

    I assume these are POP accounts and all computers are set to remove from Server after downloading.
    So on the non dominant ones... Mail Preferences>Accounts, highlight an account, Advanced tab, uncheck remove from Server, just have the main dominant one remove from server.
    Or get/setup IMAP accounts.

  • I have an Apple ID and trying to sign in for the 1st time on iTunes. When I do, I get the message: "This Apple ID has not been used with the iTunes Store. Please review your account information." When I do, I get stuck in the same loop and can't sign in!

    I have an Apple ID and trying to sign in for the 1st time on iTunes. When I do, I get the message: "This Apple ID has not been used with the iTunes Store. Please review your account information." When I do, it brings me to the same AppleID login window, and I get stuck in the same loop. I never get to the following screen to enter my account info. What's going on?? This is MADDENING!

    If you want to use it, click Review and check your account information.  Or you could contact the store support staff if you are concerned at http://www.apple.com/emea/support/itunes/contact.html for further help.

  • After installing iTunes 10.5 update i get the following message when trying to play any song in my Library "The song could not be used because the original file could not be found. Would you like to locate it?"  how do i fix this??

    I have an iPod Classic and work on Windows 7.
    i recently installed iTunes 10.5 update and since then i cannot play any of the songs in the Library - i get the following message
    "The song could not be used because the original file could not be found.  Would you like to locate it?"
    what happened to all my songs (almost 2000) How can i get them back into my music library?
    Please help - i do not want to spend another week downloading all my cd's onto my computer !!!!!

    Try my script FindTracks. Select a few of the missing files to start with then run the script. Choose No at the first prompt so that you can check how it works track by track, then confirm or edit the location of the media folder where your files are. Once you are happy with how it behaves let it process larger numbers of tracks automatically.
    tt2

  • I tried to play my iTunes and suddenly get an error message that says "The song (name) could not be used because the original file could not be found.  Would you like to locate it now?"  It happens on all my tunes and each one I select ends up with a "?"

    I tried to play my iTunes and suddenly get an error message that says "The song (name) could not be used because the original file could not be found.  Would you like to locate it now?"  It happens on each tune I select and a "?" appears beside the song.  Does this sound familiar to anyone?

    I was not complete clear.
    Since you never changed the settings in the advanced section of iTunes preferecnes, you have to chech that your music is really in the location setted in the folders reported in the advanced section.  If not you have 2 ways: reset the position of this folders or in the actual disk organisation or in the pointing on the preferences.
    If you press the reset button you just give to itunes its default setting as for the position of the music files: probably this will be a good choice if you have never changed any default preference.
    But before I would check the folders and see if the songs are really there
    In my iTune I have this, and I believe it is the default.
    Users/YOURHOMEFOLDERNAME/Music/iTunes/iTunes Music

Maybe you are looking for

  • Message File Adapter - XI Integration Server not arriving

    We have configured a file adapter to read a file.  According to the audit log the file is successfully read and converted to XML; however, the message is never posted to XI.  We have checked to make sure that no XI* users are locked and we have bounc

  • EDI to file conversion

    Please tell me how to convert EDI to File format.

  • Content Server 5 error

    Hi, can someone help me with this error message below. It is appearing in our pcserr.log. We are using CS 5.02 Thanks very much. Lars java.lang.StringIndexOutOfBoundsException: String index out of range: -37776 at java.lang.String.substring(String.ja

  • Airport extreme compatible with MacBook Pro 15" 2.33 GHz ?

    I just purchased a macbook pro and an airport extreme card to go with it. Now when I've researched it a little furhter I'm not sure if the airport extreme card will work with my new laptop. I received the card but am still waiting for the PC to arriv

  • BBSM 5.3 using RADIUS Authentication and ISA Logging

    I have a BBSM 5.3 that is configured to authenticate users via an RSA RADIUS Server and uses the transparent proxy setting which is all working. I was looking at the ISA Server logs and noted that all the log entries were using anon as the user, is i