More on my table of full scan question...

Ok. Apology. start one new thread, like other a receipt very complicated... If anyone can help Id be very grateful, because this results in a significant performance problem...

XE 11.2

Re this query:

Select ENTITY_BUDGET_CAT,

Sum (actual) real by

de)

Select Br ENTITY_BUDGET_CAT_ID as ENTITY_BUDGET_CAT,

sum (br. BRI_CREDIT) under the real name

from: br bri_recon

Group of BR. ENTITY_BUDGET_CAT_ID

)

where ENTITY_BUDGET_CAT = (SELECT "EBC". (' ' ID ' FROM 'ENTITY_BUDGET_CAT' "EBC" WHERE 'ENTITY_ID' = 55)

ENTITY_BUDGET_CAT group

The query results in a table full of BRI_RECON scan, even if there is an index on BR. ENTITY_BUDGET_CAT_ID... If I put the where conditition on the inner circle question it works fine.

The void, select retrieve entity_budget_cat on where clause returns a single value.

If I replace the subselect statement to get the entity_budget_cat with a literal value, it uses the index on ENTITY_BUDGET_CAT and is much faster with a much lower cost.

If I remove the sum (actual) external and just retrieve the value and no group, it also uses a sweep of indexes on the inner query on BRI_RECON.

I need instruction in this format because its share actually well expand with unions comprising the sum of 4 tables, then later adds the value of the outer query to retrieve a single value by group of... The docs say that the filter must be passed to any SQL internally, but everything Ive tried to change the query, but leave the internal SQL without a where clause clause and apply it on the outer query. (as I would a view) translates into a full table scan.

Here is a simple example of the view I have as an example of how the larger view needs to look for tables of the amount and return a single sum by group...

Create union_sum_view like)

Select sum (a) as a 'b' b

de)

Select nvl (sum (2), 0) as a 'b' of the double

Union of all the

Select nvl (sum (2), 0) as a 'b' of the double

)

Group by 'b '.

)

Select * from union_sum_view where b = (select "b" double)

Ive tried to put a hint about it, and it doesn't seem to make a difference...

Ive looked full statistics on the diagram too...

So my question is: what is causing the full table scan (which is clearly much less effective). And given that I need to build a view in this way, how can I change to use an index in this format, or what I do to make it work...   All variants and the traces are below...

Select ENTITY_BUDGET_CAT,

Sum (actual) real by

de)

Select Br ENTITY_BUDGET_CAT_ID as ENTITY_BUDGET_CAT,

sum (br. BRI_CREDIT) under the real name

from: br bri_recon

Group of BR. ENTITY_BUDGET_CAT_ID

)

where ENTITY_BUDGET_CAT = (SELECT "EBC". (' ' ID ' FROM 'ENTITY_BUDGET_CAT' "EBC" WHERE 'ENTITY_ID' = 55)

ENTITY_BUDGET_CAT group

| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
---------------------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | 230. 3910 | 3335 (3) | 00:00:41 |
| 1. HASH GROUP BY. 230. 3910 | 3335 (3) | 00:00:41 |
|* 2 | VIEW | 230. 3910 | 3333 (3) | 00:00:40 |
| 3. HASH GROUP BY. 230. 1610. 3333 (3) | 00:00:40 |
| 4. TABLE ACCESS FULL | BRI_RECON | 589K | 4031K | 3287 (2) | 00:00:40 |
| 5. TABLE ACCESS BY INDEX ROWID | ENTITY_BUDGET_CAT | 1. 8. 2 (0) | 00:00:01 |
|* 6 | INDEX RANGE SCAN | ENTITY_BUDGET_CAT_ENTITY_IDX1 | 1 | | 1 (0) | 00:00:01 |
---------------------------------------------------------------------------------------------------------------
Information of predicates (identified by the operation identity card):
---------------------------------------------------
2 - filter("ENTITY_BUDGET_CAT"= (SELECT "EBC".")) ID""ENTITY_BUDGET_CAT""EBC"WHERE
'ENTITY_ID' = 55))
6 - access ("ENTITY_ID" = 55)

Select ENTITY_BUDGET_CAT,

Sum (actual) real by

de)

Select Br ENTITY_BUDGET_CAT_ID as ENTITY_BUDGET_CAT,

sum (br. BRI_CREDIT) under the real name

from: br bri_recon

Group of BR. ENTITY_BUDGET_CAT_ID

)

where ENTITY_BUDGET_CAT = (382)

ENTITY_BUDGET_CAT group

| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
----------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | 1. 17. 54 (0) | 00:00:01 |
| 1. GROUP SORT BY NOSORT | 1. 17. 54 (0) | 00:00:01 |
| 2. VIEW | 1. 17. 54 (0) | 00:00:01 |
| 3. GROUP SORT BY NOSORT | 1. 7. 54 (0) | 00:00:01 |
| 4. TABLE ACCESS BY INDEX ROWID | BRI_RECON | 808 | 5656. 54 (0) | 00:00:01 |
|* 5 | INDEX RANGE SCAN | BRI_RECON_IDX_EBC | 808 | 4 (0) | 00:00:01 |
----------------------------------------------------------------------------------------------------
Information of predicates (identified by the operation identity card):
---------------------------------------------------
5 - access("BR".") ENTITY_BUDGET_CAT_ID "= 382)

Richard Legge wrote:

The void, select retrieve entity_budget_cat on where clause returns a single value.

If I replace the subselect statement to get the entity_budget_cat with a literal value, it uses the index on ENTITY_BUDGET_CAT and is much faster with a much lower cost.

Because the query runs faster when you use literal is because Oracle merges internal queries and views, so that it looks to below.

Select Br ENTITY_BUDGET_CAT_ID as ENTITY_BUDGET_CAT

sum (br. BRI_CREDIT) under the real name

from: br bri_recon

where br. ENTITY_BUDGET_CAT_ID =

Group of BR. ENTITY_BUDGET_CAT_ID

However when a subquery is used, as in the column ENTITY_BUDGET_CAT - the subquery must be run before the outer query can send more data, so that the outer query to only return results that match records based on the subquery.

Richard Legge wrote:

I need instruction in this format because its share actually well expand with unions comprising the sum of 4 tables, then later adds the value of the outer query to retrieve a single value by group of...

Maybe you should re - write the query as follows so that the optimizer would get the opportunity to merge the view and give you better performance...

Select entity_budget_cat

, sum (actual) real by

from (select br.entity_budget_cat_id as entity_budget_cat

, sum (br.bri_credit) real by

from: br bri_recon

Br.entity_budget_cat_id group

) a1

, (select ebc.id from entity_budget_cat where entity_id = 55 ebc) b1

where a1.entity_budget_cat = b1.id

A1.entity_budget_cat group;

or just... would...

Select entity_budget_cat_id entity_budget_cat

, sum (actual) real by

bri_recon a1

, (select ebc.id from entity_budget_cat where entity_id = 55 ebc) b1

where a1.entity_budget_cat_id = b1.id

A1.entity_budget_cat_id group

Tags: Database

Similar Questions

  • Full scan of Table.

    Hello
    The following query is in progress for a full table on materials scan and materialdetails tables despite having indices. Is it because of clauses of 'NOT IN' and 'NOT LIKE' at the end of this request? How can I avoid this full sweep? NOT IN with NOT EXISTS replacement help me? Please suggest.
    SELECT DISTINCT mt003_materials.materialid, 
    mt003_materialdetails.materialname,
    mt003_materials.LOCATION, 
    mt003_materials.configparam1,
     mt003_materialdetails.shortname
    FROM materials mt003_materials,
    materialdetails mt003_materialdetails
    WHERE mt003_materials.materialid =
                      mt003_materialdetails.materialid
    AND mt003_materials.mt_id = mt003_materialdetails.mt_id
    AND(((((   EXISTS (
           SELECT mt005_mtuser_privileges.materialid
          FROM mtuser_privileges mt005_mtuser_privileges INNER JOIN mtmodules mt69_mtmodules
               ON mt005_mtuser_privileges.moduleid =
                              mt69_mtmodules.moduleid
               INNER JOIN mtmodule_definition mt69_mtmodule_definition
               ON mt69_mtmodule_definition.materialid =
                    mt005_mtuser_privileges.materialid
               WHERE (    (    mt005_mtuser_privileges.personid =
                                       40000
                 )
                AND mt69_mtmodules.modulename IN ('SAL', 'SUP')
    )
               ))
     OR (mt003_materials.materialid IN (
         SELECT mt006_mt_privileges.materialid
           FROM mt_privileges mt006_mt_privileges INNER JOIN mtmodules mt69_mtmodules
                ON mt006_mt_privileges.moduleid =                                         mt69_mtmodules.moduleid  
                INNER JOIN user_groups mt3_user_groups
                ON mt3_user_groups.groupid =
                       mt006_mt_privileges.groupid
              WHERE (      
              mt69_mtmodules.modulename IN('SAL', 'SUP')
              AND mt3_agents.personid = 40000
                ))
        )
    AND mt003_materials.materialtype IN ('Scr', 'MI') )
    *AND mt003_materials.materialid NOT IN  (1,2,3,4,5,6,7,8,33,300200))*
    *AND mt003_materials.materialname NOT LIKE 'Black%' )*AND mt003_materialdetails.locale = 'US')
    AND mt003_materials.mt_id IN ('01')
           );
    Thank you

    I guess you are joinging between materials and materialdetails using the following condition to join

    materialid =  materialid
    mt_id      = mt_id
    

    First of all, you have an index on the table of materials including these two join conditions columns (materialid, mt_id)?

    Of course the CBO will almost always ignore index (if they exist) when NOT IN and LOVE NOT evaluating. See the following article from the blog for more information about this behavior

    http://richardfoote.WordPress.com/2008/08/13/indexes-and-not-equal-not-now-John/

    If you want the CBO to cover your NOT IN and LIKE NO where clause using an index access

    (a) re - write your query dependencies does not exist for example
    (b) or use an index of function according to

      create index mt_fbi_ind on material ( case when materialid in (1,2,3,4,5,6,7,8,33,300200) then null else 99999 end
                                                        ,case when materialname like 'Black%' then null else 'X' end);
    

    and change your query to match the newly created index as shown below

    select
          .....
    from
          materials         mt003_materials,
          materialdetails mt003_materialdetails
    WHERE
           mt003_materials.materialid = mt003_materialdetails.materialid
    AND mt003_materials.mt_id = mt003_materialdetails.mt_id
    
    .....
    
    AND case when materialid in (1,2,3,4,5,6,7,8,33,300200) then null else 99999 end = 99999
    AND case when materialname like 'Black%' then null else 'X' end = 'X'
    

    This is whithout knowing exactly your query and without being able to test it.

    Mohamed Houri

  • Full table scan full scan vs. Index

    Hi all

    Following is explain plan sql
    SELECT 1 FROM hz_code_assignments ca, hz_relationship_types rt,
    hz_hierarchy_nodes hn
    WHERE ca.class_category = 'RELATIONSHIP_TYPE_GROUP' AND ca.owner_table_name = 'HZ_RELATIONSHIP_TYPES. '
    AND ca.class_code = 'PARTY_REL_GRP_AR_PAY_ANY' AND ca.status = 'A' AND
    CA.owner_table_id = rt.relationship_type_id AND rt.subject_type = 'ORGANIZATION '.
    And hn.hierarchy_type = rt.relationship_type
    =====================================================================

    Operation object name lines cost TQ/exit PStart PStop bytes

    SELECT Hint = ALL_ROWS 519 508
    519 K 53 508 HASH JOIN
    NESTED LOOPS 1-97-5
    ACCESS BY INDEX ROWID 1 68 4 TABLES HZ_CODE_ASSIGNMENTS
    INDEX RANGE SCAN 15 1 HZ_CODE_ASSIGNMENTS_N1
    TABLE ACCESS BY INDEX ROWID 1-29-1 HZ_RELATIONSHIP_TYPES
    INDEX UNIQUE SCAN HZ_RELATIONSHIP_TYPES_U1 1-0
    TABLE ACCESS FULL HZ_HIERARCHY_NODES 91 K 802 502 K
    ===================================================================

    I added more tip
    SELECT / * + INDEX (HP HZ_HIERARCHY_NODES_N2) * / 1 OF hz_code_assignments ca, hz_relationship_types rt,.
    hz_hierarchy_nodes hn
    WHERE ca.class_category = 'RELATIONSHIP_TYPE_GROUP' AND ca.owner_table_name = 'HZ_RELATIONSHIP_TYPES. '
    AND ca.class_code = 'PARTY_REL_GRP_AR_PAY_ANY' AND ca.status = 'A' AND
    CA.owner_table_id = rt.relationship_type_id AND rt.subject_type = 'ORGANIZATION '.
    And hn.hierarchy_type = rt.relationship_type

    =========================================================================
    Operation object name lines cost TQ/exit PStart PStop bytes

    SELECT Hint = ALL_ROWS 519 605
    519 K 53 605 NESTED LOOPS
    NESTED LOOPS 1-97-5
    ACCESS BY INDEX ROWID 1 68 4 TABLES HZ_CODE_ASSIGNMENTS
    INDEX RANGE SCAN 15 1 HZ_CODE_ASSIGNMENTS_N1
    TABLE ACCESS BY INDEX ROWID 1-29-1 HZ_RELATIONSHIP_TYPES
    INDEX UNIQUE SCAN HZ_RELATIONSHIP_TYPES_U1 1-0
    INDEX SCAN FULL HZ_HIERARCHY_NODES_N2 6 K 53 K 600
    ================================================================

    Complete systematic index scan is always expensive

    Same query in another instance works fine

    ==================================================================
    Operation object name lines cost TQ/exit PStart PStop bytes

    SELECT Hint = 472 19 ALL_ROWS
    472 K 48 19 NESTED LOOPS
    NESTED LOOPS 1-97-2
    TABLE ACCESS BY INDEX ROWID 1 68 1 HZ_CODE_ASSIGNMENTS
    INDEX RANGE SCAN 15 1 HZ_CODE_ASSIGNMENTS_N1
    TABLE ACCESS BY INDEX ROWID 1-29-1 HZ_RELATIONSHIP_TYPES
    INDEX UNIQUE SCAN 1 1 HZ_RELATIONSHIP_TYPES_U1
    INDEX FULL SCAN HZ_HIERARCHY_NODES_N2 5 K 48 17 K
    ===============================================================

    Can anyone help find why INDEX FULL SCAN is also expensive in the second case

    Thank you

    in the application code, add the alter session statement after opening session, either before the execution of the sql statement, how exaclty this works will depend on the design of the application and if you use connection pool etc.

  • Path to XML index table is full table scan

    Hi all

    I have a version of oracle 11.2.0.4.6 database

    Try to implement partitioning on XML indexes.

    Creates a table and index partitioned by time stamp as below.

    Whenever I'm trying to find the path table makes a full table scan.

    I have applied the fix as indicated ( Doc ID 13522189.8 ).

    So the recovery is quite slow and partition pruning does not not on XML indexes.

    Wondering if anyone has experienced the same problem?

    CREATE TABLE INCIDENT

    (

    INCIDENT_PK NUMBER (14.5).

    INCIDENTGROUPING_PK NUMBER (14.5).

    INCIDENTTYPE_PK NUMBER (14.5).

    SECURITYCLASS_PK NUMBER (14.5).

    STAMP OF INCIDENT_DATE,

    SYS INCIDENT_DETAIL. XMLTYPE

    )

    TABLESPACE DATA_TBS_INCIDENT

    PCTUSED 0

    PCTFREE 10

    INITRANS 1

    MAXTRANS 255

    STORAGE)

    64K INITIALS

    MINEXTENTS 1

    MAXEXTENTS UNLIMITED

    PCTINCREASE 0

    DEFAULT USER_TABLES

    )

    LOGGING

    NOCOMPRESS

    PARTITION BY RANGE (INCIDENT_DATE)

    (PARTITION SEP2013_WEEK1 VALUES LESS THAN (to_timestamp (' 00:00:00.00 2013-09-08 ',' YYYY-MM-DD HH24:MI:SS.))) FF2')),

    PARTITION SEP2013_WEEK2 VALUES LESS THAN (to_timestamp ('2013-09-15 00:00:00.00 ',' YYYY-MM-DD HH24:MI:SS.)) FF2')),

    PARTITION SEP2013_WEEK3 VALUES LESS THAN (to_timestamp ('2013-09-22 00:00:00.00 ',' YYYY-MM-DD HH24:MI:SS.)) FF2')),

    ..........);

    CREATE the INDEX INCIDENTxdb_idx

    ON corpaudlive. INCIDENT (INCIDENT_detail) INDEXTYPE IS XDB. LOCAL XMLINDEX 10 PARALLEL

    PARAMETERS (' PATH TABLE INCIDENT_PATHTABLE (TABLESPACE DATA_TBS_INCIDENT))

    PIKEY INDEX INCIDENT_PATHTABLE_PIKEY_IX (TABLESPACE IDX_TBS_INCIDENT)

    PATH ID INDEX INCIDENT_PATHTABLE_ID_IX (TABLESPACE IDX_TBS_INCIDENT)

    INCIDENT_PATHTABLE_VALUE_IX VALUE INDEX (TABLESPACE IDX_TBS_INCIDENT)

    ORDER KEY INDEX INCIDENT_PATHTABLE_KEY_IX (TABLESPACE IDX_TBS_INCIDENT)

    Paths (INCLUDE (//forename //surname //postcode //dateofbirth //street //town))');

    SQL > explain the plan for

    2 Select INCIDENT_pk in INCIDENT where XMLEXISTS ('/ / name [text () = 'john']' by the way of INCIDENT_detail)

    3 and XMLEXISTS ("/ / name [text () 'clark' =]' by the way of INCIDENT_detail")

    4 and a.INCIDENT_date between TO_TIMESTAMP (January 10, 2014 ',' DD/MM/YYYY "")

    5 and TO_TIMESTAMP (September 10, 2014 ',' DD/MM/YYYY ');

    He explained.

    Elapsed time: 00:00:02.77

    SQL > select * from table (dbms_xplan.display);

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Hash value of plan: 123057549

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    | ID | Operation                                       | Name                           | Lines | Bytes | Cost (% CPU). Time | Pstart. Pstop |    TQ | IN-OUT | PQ Distrib.

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                                |     1.    70.  1803 (5) | 00:00:22 |       |       |        |      |            |

    |   1.  COORDINATOR OF PX |                                |       |       |            |          |       |       |        |      |            |

    |   2.   PX SEND QC (RANDOM). : TQ10003 |     1.    70.  1803 (5) | 00:00:22 |       |       |  Q1, 03 | P > S | QC (RAND) |

    |   3.    SEMI NESTED LOOPS.                                |     1.    70.  1803 (5) | 00:00:22 |       |       |  Q1, 03 | SVCP |            |

    |   4.     NESTED LOOPS |                                |     1.    57.  1800 (5) | 00:00:22 |       |       |  Q1, 03 | SVCP |            |

    |   5.      VIEW                                       | VW_SQ_1                        |   239.  5975 |  1773 (5) | 00:00:22 |       |       |  Q1, 03 | SVCP |            |

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    |   6.       UNIQUE HASH |                                |   239. 25334 |            |          |       |       |  Q1, 03 | SVCP |            |

    |   7.        RECEIVE PX |                                |   239. 25334 |            |          |       |       |  Q1, 03 | SVCP |            |

    |   8.         PX SEND HASH | : TQ10002 |   239. 25334 |            |          |       |       |  Q1, 02 | P > P | HASH |

    |   9.          UNIQUE HASH |                                |   239. 25334 |            |          |       |       |  Q1, 02 | SVCP |            |

    | * 10 |           HASH JOIN |                                |   239. 25334 |  1773 (5) | 00:00:22 |       |       |  Q1, 02 | SVCP |            |

    |  11.            KIND OF BUFFER.                                |       |       |            |          |       |       |  Q1, 02 | ISSUE |            |

    |  12.             RECEIVE PX |                                |     1.    22.     3 (0) | 00:00:01 |       |       |  Q1, 02 | SVCP |            |

    |  13.              PX SEND BROADCAST | : TQ10000 |     1.    22.     3 (0) | 00:00:01 |       |       |        | S > P | BROADCAST |

    |  14.               TABLE ACCESS BY INDEX ROWID | X$ PT74MSS0WBH028JE0GUCLBK0LHM4 |     1.    22.     3 (0) | 00:00:01 |       |       |        |      |            |

    | * 15 |                INDEX RANGE SCAN | X$ PR74MSS0WBH028JE0GUCLBK0LHM4 |     1.       |     2 (0) | 00:00:01 |       |       |        |      |            |

    | * 16.            HASH JOIN |                                | 12077 |   990K |  1770 (5) | 00:00:22 |       |       |  Q1, 02 | SVCP |            |

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    |  17.             RECEIVE PX |                                |   250K |    10 M |    39 (0) | 00:00:01 |       |       |  Q1, 02 | SVCP |            |

    |  18.              PX SEND BROADCAST | : TQ10001 |   250K |    10 M |    39 (0) | 00:00:01 |       |       |  Q1, 01 | P > P | BROADCAST |

    |  19.               SYSTEM PARTITION ALL |                                |   250K |    10 M |    39 (0) | 00:00:01 |     1.   112.  Q1, 01 | ISSUE |            |

    | * 20.                TABLE ACCESS BY LOCAL INDEX ROWID | INCIDENT_PATHTABLE |   250K |    10 M |    39 (0) | 00:00:01 |     1.   112.  Q1, 01 | SVCP |            |

    | * 21.                 INDEX RANGE SCAN | INCIDENT_PATHTABLE_VALUE_IX |   161.       |    25 (0) | 00:00:01 |     1.   112.  Q1, 01 | SVCP |            |

    |  22.             ITERATOR BLOCK PX |                                |   221 M |  8865M |  1671 (1) | 00:00:21 |    53.    54.  Q1, 02 | ISSUE |            |

    | * 23.              TABLE ACCESS FULL | INCIDENT_PATHTABLE |   221 M |  8865M |  1671 (1) | 00:00:21 |    53.    54.  Q1, 02 | SVCP |            |

    | * 24.      TABLE ACCESS BY ROWID USER | INCIDENT |     1.    32.     1 (0) | 00:00:01 | ROWID | ROWID |  Q1, 03 | SVCP |            |

    | * 25.     SEE PUSHED PREDICATE. VW_SQ_2                        |     1.    13.    20 (0) | 00:00:01 |       |       |  Q1, 03 | SVCP |            |

    |  26.      NESTED LOOPS |                                |     1.   106.    20 (0) | 00:00:01 |       |       |  Q1, 03 | SVCP |            |

    |  27.       NESTED LOOPS |                                |     4.   106.    20 (0) | 00:00:01 |       |       |  Q1, 03 | SVCP |            |

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    |  28.        NESTED LOOPS |                                |     4.   256.     8 (0) | 00:00:01 |       |       |  Q1, 03 | SVCP |            |

    |  29.         TABLE ACCESS BY INDEX ROWID | X$ PT74MSS0WBH028JE0GUCLBK0LHM4 |     1.    22.     3 (0) | 00:00:01 |       |       |  Q1, 03 | SVCP |            |

    | * 30 |          INDEX RANGE SCAN | X$ PR74MSS0WBH028JE0GUCLBK0LHM4 |     1.       |     2 (0) | 00:00:01 |       |       |  Q1, 03 | SVCP |            |

    |  31.         ITERATOR SYSTEM PARTITION.                                |     4.   168.     5 (0) | 00:00:01 |    53.    54.  Q1, 03 | SVCP |            |

    | * 32 |          TABLE ACCESS BY LOCAL INDEX ROWID | INCIDENT_PATHTABLE |     4.   168.     5 (0) | 00:00:01 |    53.    54.  Q1, 03 | SVCP |            |

    | * 33 |           INDEX RANGE SCAN | INCIDENT_PATHTABLE_PIKEY_IX |     4.       |     4 (0) | 00:00:01 |    53.    54.  Q1, 03 | SVCP |            |

    |  34.        ITERATOR SYSTEM PARTITION.                                |     1.       |     2 (0) | 00:00:01 |   KEY |   KEY |  Q1, 03 | SVCP |            |

    | * 35 |         INDEX RANGE SCAN | INCIDENT_PATHTABLE_KEY_IX |     1.       |     2 (0) | 00:00:01 |   KEY |   KEY |  Q1, 03 | SVCP |            |

    | * 36 |       TABLE ACCESS BY LOCAL INDEX ROWID | INCIDENT_PATHTABLE |     1.    42.     3 (0) | 00:00:01 |     1.     1.  Q1, 03 | SVCP |            |

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    10 - access("SYS_P9".") PATHID '=' ID')

    Access (SYS_PATH_REVERSE ("PATH") 15 - > = HEXTORAW ('02582E') AND SYS_PATH_REVERSE ("PATH") < HEXTORAW ('02582EFF'))

    16 - access("SYS_P11".") RID "IS 'SYS_P9'." GET RID OF"AND TBL$ OR$ IDX$ PART$ NUM ("CORPAUDLIVE". "THE INCIDENT", 0,7,65535, "SYS_P9" "." " "RID") = TBL$ OR$ IDX$ PART$ NUM ("CORPAUDLIVE". "INCIDENT_PATHTAB

    THE', 0,7,65535, ROWID))

    filter ("SYS_P9". "ORDER_KEY" < = 'SYS_P11' "." " ORDER_KEY' AND 'SYS_P11 '. "" ORDER_KEY "< SYS_ORDERKEY_MAXCHILD ("SYS_P9". "ORDER_KEY")) "

    20 filter (SYS_XMLI_LOC_ISTEXT ("SYS_P11". "LOCATOR", "SYS_P11" "." " PATHID') = 1)

    21 - access("SYS_P11".") The VALUE "= 'John')

    23 filter (SYS_XMLI_LOC_ISNODE ("SYS_P9". "LOCATOR") = 1 AND SYS_OP_BLOOM_FILTER (: BF0000, "SYS_P9".) " PATHID'))

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    24 - filter("A".") INCIDENT_DATE' > = TIMESTAMP' 2014 - 10 - 01 00:00:00.000000000 "AND"A"". "" INCIDENT_DATE"< = TIMESTAMP' 2014 - 10 - 09 00:00:00.000000000' AND

    "ITEM_2" = TBL$ OR$ IDX$ PART$ NUM ("INCIDENT", 0,7,65535, "A". ROWID))

    25 filter ("ITEM_4" = TBL$ OR$ IDX$ PART$ NUM ("INCIDENT", 0,7,65535, "A".) ROWID))

    30 - access (SYS_PATH_REVERSE ("PATH") > = HEXTORAW('027FF9') AND SYS_PATH_REVERSE ("PATH") < HEXTORAW ('027FF9FF'))

    32 filter (SYS_XMLI_LOC_ISNODE ("SYS_P2". "LOCATOR") = 1) "

    33 - access("SYS_P2".") GET RID OF"="A ". ROWID AND 'SYS_P2 '. ("' PATHID '=' ID ')

    35 - access("SYS_P4".") GET RID OF"="A ". ROWID AND 'SYS_P2 '. "" ORDER_KEY "< ="SYS_P4. " "" ORDER_KEY "AND"SYS_P4 ". "" ORDER_KEY "< SYS_ORDERKEY_MAXCHILD ("SYS_P2". "ORDER_KEY")) "

    filter ("SYS_P4". "RID"IS "SYS_P2"." GET RID OF"AND TBL$ OR$ IDX$ PART$ NUM("INCIDENT",0,7,65535,"SYS_P2".") "RID") = TBL$ OR$ IDX$ PART$ NUM ("INCIDENT_PATHTABL

    E «(, 0,7,65535, ROWID)).

    36 - filter("SYS_P4".") The VALUE '= 'clark' AND SYS_XMLI_LOC_ISTEXT ("SYS_P4".' LOCATOR', 'SYS_P4 '. (("" PATHID ') = 1).

    PLAN_TABLE_OUTPUT

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Note

    -----

    -dynamic sample used for this survey (level = 6)

    69 selected lines.

    Elapsed time: 00:00:00.47

    SQL > spool off

    Thank you

    CenterB

    You must create a XMLIndex with two groups:

    create table actionnew)

    number of action_pk

    action_date timestamp

    action_detail xmltype

    )

    partition by (range (action_date)

    partition values before_2015 less (timestamp ' 2015-01-01 00:00:00 ')

    , partition values jan_2015 less (timestamp ' 2015-02-01 00:00:00 ')

    , partition values feb_2015 less (timestamp ' 2015-03-01 00:00:00 ')

    );

    create index actionnew_sxi on actionnew (action_detail)

    indexType is xdb.xmlindex

    local

    parameters (q'~)

    Group my_group_1

    XMLTable actionnew_xt1

    "/ audit/action_details/screen_data/tables/table/row.

    path of varchar2 (100) the columns "name".

    , path of surname varchar2 (100) "first name".

    Group my_group_2

    XMLTable actionnew_xt2

    "/ audit/action_details/fields.

    path of varchar2 (100) the columns "name".

    , path of surname varchar2 (100) "first name".

    ~'

    );

    Select x.*

    to actionnew t

    xmltable)

    "/ audit/action_details/screen_data/tables/table/row.

    in passing t.action_detail

    path of varchar2 (100) the columns "name".

    , path of surname varchar2 (100) "first name".

    ) x

    where t.action_date between timestamp ' 2015-02-01 00:00:00 '

    and timestamp ' 2015-03-01 00:00:00 '

    and x.forename = 'anwardo. '

    and x.surname = 'gram '.

    ;

  • Query not using Full Scan Index

    Hello world

    I'm on 11.2.0.3.0 AIX 6.1.

    There is a query such as:

    Select: sys_b_0 | Count (distinct (column_name)) table;

    that goes for the analysis full table. The column was values separate only 104 with not NULL values. To save memory buffer gets, I created an index on the table with the column used in the query (i.e. whose distinct values are recovered).

    The problem is that even after the creation of indexes and force the flag index that it does not use the full scan of the index. The provided indication is correct in syntax and was the only clue in the query, so there is no question of conflicts with others.

    Can anyone suggest me what I might be missing?

    Thank you

    It seems to me that if print_branch_code is defined as nullable in the table. If this is the case, the optimizer goes for a sweep of index, even if there is no real NULL values

  • Why the optimizer ignores Index Fast full Scan when much lower cost?

    Summary (tracking details below) - to improve the performance of a query on more than one table, I created an index on a table that included all the columns referenced in the query. With the new index in place the optimizer is still choosing a full Table Scan on an Index fast full scan. However, by removing the one query tables I reach the point where the optimizer suddenly use the Index Fast Full Scan on this table. And 'Yes', it's a lot cheaper than the full Table Scan it used before. By getting a test case, I was able to get the motion down to 4 tables with the optimizer still ignoring the index and table of 3, it will use the index.

    So why the optimizer not chooses the Index Fast Full Scan, if it is obvious that it is so much cheaper than a full Table Scan? And why the deletion of a table changes how the optimizer - I don't think that there is a problem with the number of join permutations (see below). The application is so simple that I can do, while remaining true to the original SQL application, and it still shows this reversal in the choice of access path. I can run the queries one after another, and he always uses a full Table Scan for the original query and Index fast full scan for the query that is modified with a table less.

    Watching trace 10053 output for the two motions, I can see that for the original query 4 table costs alone way of ACCESS of TABLE UNIQUE section a full Table Scan. But for the modified query with a table less, the table now has a cost for an Index fast full scan also. And the end of the join cost 10053 does not end with a message about exceeding the maximum number of permutations. So why the optimizer does not cost the IFFS for the first query, when it does for the second, nearly identical query?

    This is potentially a problem to do with OUTER joins, but why? The joins between the tables do not change when the single extra table is deleted.

    It's on 10.2.0.5 on Linux (Oracle Enterprise Linux). I did not define special settings I know. I see the same behavior on 10.2.0.4 32-bit on Windows (XP).

    Thank you
    John
    Blog of database Performance

    DETAILS
    I've reproduced the entire scenario via SQL scripts to create and populate the tables against which I can then run the queries. I've deliberately padded table so that the length of the average line of data generated is similar to that of the actual data. In this way the statistics should be similar on the number of blocks and so forth.

    System - uname - a
    Linux mysystem.localdomain 2.6.32-300.25.1.el5uek #1 SMP Tue May 15 19:55:52 EDT 2012 i686 i686 i386 GNU/Linux
    Database - v$ version
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for Linux: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    Original query (complete table below details):
    SELECT 
        episode.episode_id , episode.cross_ref_id , episode.date_required , 
        product.number_required , 
        request.site_id 
    FROM episode 
    LEFT JOIN REQUEST on episode.cross_ref_id = request.cross_ref_id 
         JOIN product ON episode.episode_id = product.episode_id 
    LEFT JOIN product_sub_type ON product.prod_sub_type_id = product_sub_type.prod_sub_type_id 
    WHERE (
            episode.department_id = 2
        and product.status = 'I'
          ) 
    ORDER BY episode.date_required
    ;
    Execution of display_cursor after the execution plan:
    SQL_ID  5ckbvabcmqzw7, child number 0
    -------------------------------------
    SELECT     episode.episode_id , episode.cross_ref_id , episode.date_required ,
    product.number_required ,     request.site_id FROM episode LEFT JOIN REQUEST on
    episode.cross_ref_id = request.cross_ref_id      JOIN product ON episode.episode_id =
    product.episode_id LEFT JOIN product_sub_type ON product.prod_sub_type_id =
    product_sub_type.prod_sub_type_id WHERE (         episode.department_id = 2 and
    product.status = 'I'       ) ORDER BY episode.date_required
    
    Plan hash value: 3976293091
    
    -----------------------------------------------------------------------------------------------------
    | Id  | Operation             | Name                | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT      |                     |       |       |       | 35357 (100)|          |
    |   1 |  SORT ORDER BY        |                     | 33333 |  1920K|  2232K| 35357   (1)| 00:07:05 |
    |   2 |   NESTED LOOPS OUTER  |                     | 33333 |  1920K|       | 34879   (1)| 00:06:59 |
    |*  3 |    HASH JOIN OUTER    |                     | 33333 |  1822K|  1728K| 34878   (1)| 00:06:59 |
    |*  4 |     HASH JOIN         |                     | 33333 |  1334K|       |   894   (1)| 00:00:11 |
    |*  5 |      TABLE ACCESS FULL| PRODUCT             | 33333 |   423K|       |   103   (1)| 00:00:02 |
    |*  6 |      TABLE ACCESS FULL| EPISODE             |   299K|  8198K|       |   788   (1)| 00:00:10 |
    |   7 |     TABLE ACCESS FULL | REQUEST             |  3989K|    57M|       | 28772   (1)| 00:05:46 |
    |*  8 |    INDEX UNIQUE SCAN  | PK_PRODUCT_SUB_TYPE |     1 |     3 |       |  0   (0)|          |
    -----------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       3 - access("EPISODE"."CROSS_REF_ID"="REQUEST"."CROSS_REF_ID")
       4 - access("EPISODE"."EPISODE_ID"="PRODUCT"."EPISODE_ID")
       5 - filter("PRODUCT"."STATUS"='I')
       6 - filter("EPISODE"."DEPARTMENT_ID"=2)
       8 - access("PRODUCT"."PROD_SUB_TYPE_ID"="PRODUCT_SUB_TYPE"."PROD_SUB_TYPE_ID")
    Updated the Query:
    SELECT 
        episode.episode_id , episode.cross_ref_id , episode.date_required , 
        product.number_required , 
        request.site_id 
    FROM episode 
    LEFT JOIN REQUEST on episode.cross_ref_id = request.cross_ref_id 
         JOIN product ON episode.episode_id = product.episode_id 
    WHERE (
            episode.department_id = 2
        and product.status = 'I'
          ) 
    ORDER BY episode.date_required
    ;
    Execution of display_cursor after the execution plan:
    SQL_ID  gbs74rgupupxz, child number 0
    -------------------------------------
    SELECT     episode.episode_id , episode.cross_ref_id , episode.date_required ,
    product.number_required ,     request.site_id FROM episode LEFT JOIN REQUEST on
    episode.cross_ref_id = request.cross_ref_id      JOIN product ON episode.episode_id =
    product.episode_id WHERE (         episode.department_id = 2     and product.status =
    'I'       ) ORDER BY episode.date_required
    
    Plan hash value: 4250628916
    
    ----------------------------------------------------------------------------------------------
    | Id  | Operation              | Name        | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    ----------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT       |             |       |       |       | 10515 (100)|          |
    |   1 |  SORT ORDER BY         |             | 33333 |  1725K|  2112K| 10515   (1)| 00:02:07 |
    |*  2 |   HASH JOIN OUTER      |             | 33333 |  1725K|  1632K| 10077   (1)| 00:02:01 |
    |*  3 |    HASH JOIN           |             | 33333 |  1236K|       |   894   (1)| 00:00:11 |
    |*  4 |     TABLE ACCESS FULL  | PRODUCT     | 33333 |   325K|       |   103   (1)| 00:00:02 |
    |*  5 |     TABLE ACCESS FULL  | EPISODE     |   299K|  8198K|       |   788   (1)| 00:00:10 |
    |   6 |    INDEX FAST FULL SCAN| IX4_REQUEST |  3989K|    57M|       |  3976   (1)| 00:00:48 |
    ----------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("EPISODE"."CROSS_REF_ID"="REQUEST"."CROSS_REF_ID")
       3 - access("EPISODE"."EPISODE_ID"="PRODUCT"."EPISODE_ID")
       4 - filter("PRODUCT"."STATUS"='I')
       5 - filter("EPISODE"."DEPARTMENT_ID"=2)
    Creating the table and Population:
    1 create tables
    2. load data
    3 create indexes
    4. collection of statistics
    --
    -- Main table
    --
    create table episode (
    episode_id number (*,0),
    department_id number (*,0),
    date_required date,
    cross_ref_id varchar2 (11),
    padding varchar2 (80),
    constraint pk_episode primary key (episode_id)
    ) ;
    --
    -- Product tables
    --
    create table product_type (
    prod_type_id number (*,0),
    code varchar2 (10),
    binary_field number (*,0),
    padding varchar2 (80),
    constraint pk_product_type primary key (prod_type_id)
    ) ;
    --
    create table product_sub_type (
    prod_sub_type_id number (*,0),
    sub_type_name varchar2 (20),
    units varchar2 (20),
    padding varchar2 (80),
    constraint pk_product_sub_type primary key (prod_sub_type_id)
    ) ;
    --
    create table product (
    product_id number (*,0),
    prod_type_id number (*,0),
    prod_sub_type_id number (*,0),
    episode_id number (*,0),
    status varchar2 (1),
    number_required number (*,0),
    padding varchar2 (80),
    constraint pk_product primary key (product_id),
    constraint nn_product_episode check (episode_id is not null) 
    ) ;
    alter table product add constraint fk_product 
    foreign key (episode_id) references episode (episode_id) ;
    alter table product add constraint fk_product_type 
    foreign key (prod_type_id) references product_type (prod_type_id) ;
    alter table product add constraint fk_prod_sub_type
    foreign key (prod_sub_type_id) references product_sub_type (prod_sub_type_id) ;
    --
    -- Requests
    --
    create table request (
    request_id number (*,0),
    department_id number (*,0),
    site_id number (*,0),
    cross_ref_id varchar2 (11),
    padding varchar2 (80),
    padding2 varchar2 (80),
    constraint pk_request primary key (request_id),
    constraint nn_request_department check (department_id is not null),
    constraint nn_request_site_id check (site_id is not null)
    ) ;
    --
    -- Activity & Users
    --
    create table activity (
    activity_id number (*,0),
    user_id number (*,0),
    episode_id number (*,0),
    request_id number (*,0), -- always NULL!
    padding varchar2 (80),
    constraint pk_activity primary key (activity_id)
    ) ;
    alter table activity add constraint fk_activity_episode
    foreign key (episode_id) references episode (episode_id) ;
    alter table activity add constraint fk_activity_request
    foreign key (request_id) references request (request_id) ;
    --
    create table app_users (
    user_id number (*,0),
    user_name varchar2 (20),
    start_date date,
    padding varchar2 (80),
    constraint pk_users primary key (user_id)
    ) ;
    
    prompt Loading episode ...
    --
    insert into episode
    with generator as 
    (select rownum r
              from (select rownum r from dual connect by rownum <= 1000) a,
                   (select rownum r from dual connect by rownum <= 1000) b,
                   (select rownum r from dual connect by rownum <= 1000) c
             where rownum <= 1000000
           ) 
    select r, 2,
        sysdate + mod (r, 14),
        to_char (r, '0000000000'),
        'ABCDEFGHIJKLMNOPQRSTUVWXYZ' || to_char (r, '000000')
      from generator g
    where g.r <= 300000
    /
    commit ;
    --
    prompt Loading product_type ...
    --
    insert into product_type
    with generator as 
    (select rownum r
              from (select rownum r from dual connect by rownum <= 1000) a,
                   (select rownum r from dual connect by rownum <= 1000) b,
                   (select rownum r from dual connect by rownum <= 1000) c
             where rownum <= 1000000
           ) 
    select r, 
           to_char (r, '000000000'),
           mod (r, 2),
           'ABCDEFGHIJKLMNOPQRST' || to_char (r, '000000')
      from generator g
    where g.r <= 12
    /
    commit ;
    --
    prompt Loading product_sub_type ...
    --
    insert into product_sub_type
    with generator as 
    (select rownum r
              from (select rownum r from dual connect by rownum <= 1000) a,
                   (select rownum r from dual connect by rownum <= 1000) b,
                   (select rownum r from dual connect by rownum <= 1000) c
             where rownum <= 1000000
           ) 
    select r, 
           to_char (r, '000000'),
           to_char (mod (r, 3), '000000'),
           'ABCDE' || to_char (r, '000000')
      from generator g
    where g.r <= 15
    /
    commit ;
    --
    prompt Loading product ...
    --
    -- product_id prod_type_id prod_sub_type_id episode_id padding 
    insert into product
    with generator as 
    (select rownum r
              from (select rownum r from dual connect by rownum <= 1000) a,
                   (select rownum r from dual connect by rownum <= 1000) b,
                   (select rownum r from dual connect by rownum <= 1000) c
             where rownum <= 1000000
           ) 
    select r, mod (r, 12) + 1, mod (r, 15) + 1, mod (r, 300000) + 1,
           decode (mod (r, 3), 0, 'I', 1, 'C', 2, 'X', 'U'),
           dbms_random.value (1, 100), NULL
      from generator g
    where g.r <= 100000
    /
    commit ;
    --
    prompt Loading request ...
    --
    -- request_id department_id site_id cross_ref_id varchar2 (11) padding 
    insert into request
    with generator as 
    (select rownum r
              from (select rownum r from dual connect by rownum <= 1000) a,
                   (select rownum r from dual connect by rownum <= 1000) b,
                   (select rownum r from dual connect by rownum <= 1000) c
             where rownum <= 10000000
           ) 
    select r, mod (r, 4) + 1, 1, to_char (r, '0000000000'),
    'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz01234567890123456789' || to_char (r, '000000'),
    'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789012345678' || to_char (r, '000000')
      from generator g
    where g.r <= 4000000
    /
    commit ;
    --
    prompt Loading activity ...
    --
    -- activity activity_id user_id episode_id request_id (NULL) padding 
    insert into activity
    with generator as 
    (select rownum r
              from (select rownum r from dual connect by rownum <= 1000) a,
                   (select rownum r from dual connect by rownum <= 1000) b,
                   (select rownum r from dual connect by rownum <= 1000) c
             where rownum <= 10000000
           ) 
    select r, mod (r, 50) + 1, mod (r, 300000) + 1, NULL, NULL
      from generator g
    where g.r <= 100000
    /
    commit ;
    --
    prompt Loading app_users ...
    --
    -- app_users user_id user_name start_date padding 
    insert into app_users
    with generator as 
    (select rownum r
              from (select rownum r from dual connect by rownum <= 1000) a,
                   (select rownum r from dual connect by rownum <= 1000) b,
                   (select rownum r from dual connect by rownum <= 1000) c
             where rownum <= 10000000
           ) 
    select r, 
           'User_' || to_char (r, '000000'),
           sysdate - mod (r, 30),
           'ABCDEFGHIJKLMNOPQRSTUVWXYZ' || to_char (r, '000000')
      from generator g
    where g.r <= 1000
    /
    commit ;
    --
    
    prompt Episode (1)
    create index ix1_episode_cross_ref on episode (cross_ref_id) ;
    --
    prompt Product (2)
    create index ix1_product_episode on product (episode_id) ;
    create index ix2_product_type on product (prod_type_id) ;
    --
    prompt Request (4)
    create index ix1_request_site on request (site_id) ;
    create index ix2_request_dept on request (department_id) ;
    create index ix3_request_cross_ref on request (cross_ref_id) ;
    -- The extra index on the referenced columns!!
    create index ix4_request on request (cross_ref_id, site_id) ;
    --
    prompt Activity (2)
    create index ix1_activity_episode on activity (episode_id) ;
    create index ix2_activity_request on activity (request_id) ;
    --
    prompt Users (1)
    create unique index ix1_users_name on app_users (user_name) ;
    --
    prompt Gather statistics on schema ...
    --
    exec dbms_stats.gather_schema_stats ('JB')
    10053 sections - original query
    ***************************************
    SINGLE TABLE ACCESS PATH
      -----------------------------------------
      BEGIN Single Table Cardinality Estimation
      -----------------------------------------
      Table: REQUEST  Alias: REQUEST
        Card: Original: 3994236  Rounded: 3994236  Computed: 3994236.00  Non Adjusted: 3994236.00
      -----------------------------------------
      END   Single Table Cardinality Estimation
      -----------------------------------------
      Access Path: TableScan
        Cost:  28806.24  Resp: 28806.24  Degree: 0
          Cost_io: 28738.00  Cost_cpu: 1594402830
          Resp_io: 28738.00  Resp_cpu: 1594402830
    ******** Begin index join costing ********
      ****** trying bitmap/domain indexes ******
      Access Path: index (FullScan)
        Index: PK_REQUEST
        resc_io: 7865.00  resc_cpu: 855378926
        ix_sel: 1  ix_sel_with_filters: 1
        Cost: 7901.61  Resp: 7901.61  Degree: 0
      Access Path: index (FullScan)
        Index: PK_REQUEST
        resc_io: 7865.00  resc_cpu: 855378926
        ix_sel: 1  ix_sel_with_filters: 1
        Cost: 7901.61  Resp: 7901.61  Degree: 0
      ****** finished trying bitmap/domain indexes ******
    ******** End index join costing ********
      Best:: AccessPath: TableScan
             Cost: 28806.24  Degree: 1  Resp: 28806.24  Card: 3994236.00  Bytes: 0
    ***************************************
    10053 - updated the Query
    ***************************************
    SINGLE TABLE ACCESS PATH
      -----------------------------------------
      BEGIN Single Table Cardinality Estimation
      -----------------------------------------
      Table: REQUEST  Alias: REQUEST
        Card: Original: 3994236  Rounded: 3994236  Computed: 3994236.00  Non Adjusted: 3994236.00
      -----------------------------------------
      END   Single Table Cardinality Estimation
      -----------------------------------------
      Access Path: TableScan
        Cost:  28806.24  Resp: 28806.24  Degree: 0
          Cost_io: 28738.00  Cost_cpu: 1594402830
          Resp_io: 28738.00  Resp_cpu: 1594402830
      Access Path: index (index (FFS))
        Index: IX4_REQUEST
        resc_io: 3927.00  resc_cpu: 583211030
        ix_sel: 0.0000e+00  ix_sel_with_filters: 1
      Access Path: index (FFS)
        Cost:  3951.96  Resp: 3951.96  Degree: 1
          Cost_io: 3927.00  Cost_cpu: 583211030
          Resp_io: 3927.00  Resp_cpu: 583211030
      Access Path: index (FullScan)
        Index: IX4_REQUEST
        resc_io: 14495.00  resc_cpu: 903225273
        ix_sel: 1  ix_sel_with_filters: 1
        Cost: 14533.66  Resp: 14533.66  Degree: 1
    ******** Begin index join costing ********
      ****** trying bitmap/domain indexes ******
      Access Path: index (FullScan)
        Index: IX4_REQUEST
        resc_io: 14495.00  resc_cpu: 903225273
        ix_sel: 1  ix_sel_with_filters: 1
        Cost: 14533.66  Resp: 14533.66  Degree: 0
      Access Path: index (FullScan)
        Index: IX4_REQUEST
        resc_io: 14495.00  resc_cpu: 903225273
        ix_sel: 1  ix_sel_with_filters: 1
        Cost: 14533.66  Resp: 14533.66  Degree: 0
      ****** finished trying bitmap/domain indexes ******
    ******** End index join costing ********
      Best:: AccessPath: IndexFFS  Index: IX4_REQUEST
             Cost: 3951.96  Degree: 1  Resp: 3951.96  Card: 3994236.00  Bytes: 0
    ***************************************

    I mentioned that it is a bug related to the ANSI SQL standard and transformation probably.

    As suggested/asked in my first reply:
    1. If you use a no_query_transformation then you should find that you get the use of the index (although not in the plan you would expect)
    2. If you use the traditional Oracle syntax, then you should not have the same problem.

  • index range scan and full scan limited index

    Hi master,

    I always think to what is the difference between index scan and scan of comprehensive systematic index range...


    comprehensive index analysis applied to the full index sheet, block and root structure.

    How systematic index scan range works internally? How is it different from complete systematic index scan? When to use the scan of the index systematic range? which is expensive?

    I like what internals discuss some docs on these, but nobody... someone knows about any link lewis j. wrote about these scans?

    will be useful

    Thanks and greetings
    VD

    Vikrant dixit says:
    I always think to what is the difference between index scan and scan of comprehensive systematic index range...

    There is essentially no difference.

    Based on a seed value, Oracle checks the root block using the partial keys stored to select which block from the next down level (typically a layer of blocks of branch) to go to.

    Since the relevant branch block, she uses the partial keys to identify which block in the level down to go to (usually a block of sheets).

    When he reached a block of sheets, it can find the first relevant key value, then scroll through the list of keys to jump to the table. If it reaches the end of the block of sheets, it uses the "next" pointer to reach the next block of relevant leaves.

    Because the optimizer has enough information to establish a baseline and a final value for the analysis, the runtime can keep journal journal moving until it hits the sheet "stop".

    The only difference between the full analysis and analysis of the range is the full scan down through the branches to the first sheet of the index and traverses the index to the last sheet. (Indeed, the starting value is less "Infinity" and the end value is "more Infinity".)

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    http://www.jlcomp.demon.co.UK

    "Science is more than a body of knowledge; It's a way of thinking"Carl Sagan

  • Auto weekly full scan never start despite all the settings are correct

    I use XP and I was using AVG which I could always count on doing my Automatic weekly Full Scan. I've been using Microsoft Security Essentials since the beginning of the summer, but I'm a little worried it won't kick and do my weekly analysis automatically. I always have to do it manually. Is this a common problem, I know two other people with the same problem. I double checked all the settings and everything is as it should be.

    Hello

    Getting started with Microsoft Security Essentials
    Refer (Scheduling scans) links
    If you got the question, then you uinstall and resinstall Microsoft Security Essentials
    Protect your PC
    Download Microsoft Security Essentials for the low price, low free.
    Help protect your PC with Microsoft Security Essentials
  • I'm running a full scan of the system with my anti-virus software and it filled almost my laptop crashes, problem with the vga865.fon file

    I'm running a full scan of the system with my anti-virus software and it filled almost my laptop breaks down when it comes to: -.

    c:\windows\winsxs\x86_microsoft-Windows-font-bitmap-oem_31bf3856ad364e35_6.0.6000.16386_none_fb2d5aefb17b8d65\vga865.FON

    This file can be replaced.  When I scan this folder individually its fine, please help

    Thank you

    Hello

    What protection software antivirus you are running on the computer?

    Method 1: Check if you can run the scan in safe mode without in all questions

    Follow the steps mentioned in the link below to access the secure mode
    Startup options (including safe mode)

    Method 2: you can run Safe Mode security monitor, see the steps in the article below
    How to install the free Windows Live OneCare Safety Scanner and then scan your computer in Mode safe

    Method 3: Follow the steps mentioned in the link below to check your hard disk for errors, and then check if the problem is resolved
    Check your hard drive for errors

    If the problem persists,

    Method 4: Long file name could cause this problem, perform a backup of the file (copy it somewhere else), and then rename the file, check to see if that makes a difference

    Note: Copy the file to the original location.

    Thank you, and in what concerns:

    Ajay K

    Microsoft Answers Support Engineer
    ***************************************************************************
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • When you run a full scan on windows 7, it can take up to 9 hours.

    I noticed that it takes up to 9 hours to run a full scan in windows 7. Windows Installer seems to be very important when it comes to scanning, as well as others. Is there a way to clean up some of these files, as well as the analysis does not take as long? Or 9 hours an acceptable amount of time to run a scan completes. It seems more 1 million files, is this normal?

    Hello GarryHall,

    The analysis of the file system by using a virus scanner can take hours depending on the number of installed software and drivers. If you have many programs installed on your system, it can really take a lot of time. There is nothing bad about it.

  • Microsoft Security Essentials Full Scan is turned off

    When I try to run a full scan, analysis is constantly interrupted because the screen switches to switch users.
    I have all the options changed forever energy saving.  I keep having to go back to my computer to use the
    Scan and it takes all day.
    Thank you for your help.

    Hello

    Make sure that you have disabled "On summary, display logon" in the Windows settings.

    1. go in the 'Control Panel '.
    2. click on "appearance and personalization".
    3. click on "change screen saver.
    4 uncheck "on summary, the logon screen.

    This will not allow the computer to enter the lock screen, when it is idle.

    About the analysis of taking security over time to complete, here are some links Microsoft Community that will help you.

    http://answers.Microsoft.com/en-us/protect/Forum/MSE-protect_scanning/time-for-the-full-system-scan-too-long/0946caf5-6421-4829-b657-cf13aef188cf

    http://answers.Microsoft.com/en-us/protect/Forum/MSE-protect_scanning/how-long-should-a-full-scan-take/6e0258a0-857E-E011-9b4b-68b599b31bf5

    Hope this information helps. If you have any questions, please let us know.

  • Windows Essential slow full scan

    Why the full scan takes 9 hours? Why when analysis indicates through the complete green line continues? It is impractiocal since I never leave my computer on more than 4 hours.

    I would uninstall Security Essentials, reboot and then reinstall. See if that helps.

    It depends on the size/number of files as to how long the analysis will take.

  • When Oracle make Index Fast full Scan?

    Hi all

    In this case, Oracle index full scan. Please give the solution with at least two example.

    Thank you

    Oops,

    Spleen it was INDEX FAST FULL SCAN. Then index must be greater:

    SQL > create table tbl in select * from dba_objects;

    Table created.

    SQL > alter table tbl
    2 edit object_name not null;

    Modified table.

    SQL > create index tbl_idx1 on tbl (object_name);

    The index is created.

    SQL > explain the plan for
    2. Select object_name in tbl;

    He explained.

    SQL > select * from table (dbms_xplan.display);

    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------
    Hash value of plan: 2675010997

    ---------------------------------------------------------------------------------
    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
    ---------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT |          | 69022 |  4448K |   109 (1) | 00:00:02 |
    |   1.  FULL RESTRICTED INDEX SCAN FAST | TBL_IDX1 | 69022 |  4448K |   109 (1) | 00:00:02 |
    ---------------------------------------------------------------------------------

    Note
    -----

    PLAN_TABLE_OUTPUT
    ----------------------------------------------------------------------------------
    -dynamic sample used for this survey (level = 2)

    12 selected lines.

    SQL >

    SY.

  • Reg - full scan limited index

    Hi Experts/gurus,
    I read Oracle http://docs.oracle.com/cd/B19306_01/server.102/b14211/optimops.htm#i52044 docs, i.e. the difference between the range index scans, full scan and full scan index restricts index. Here is the description of 'Fast Full Index Scans'

    Full index scans are an alternative to a full table scan when the index contains all the columns needed for the query, and at least one column in the index key has the NOT NULL constraint. A full scan accesses the data in the index itself, without access to the table. It can be used to eliminate a sort operation, because the data are not classified by the index key. It reads the entire index using multiblock bed, unlike a full index scan and can be parallelized.

    Therefore, the document says, the optimizer to choose index FFS, 'at least in the index key column a NOT NULL constraint', but I see less test cases is in complete contrast to what I've read.

    I created a table without constraints "NOT NULL".
    SQL> create table r_dummy(a number,b varchar2(10));
    
    Table created.
    
    SQL> insert into r_dummy select level,'hi' from dual connect by level<=20;
    
    20 rows created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> exec dbms_stats.gather_table_stats('HLODS','R_DUMMY');
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from r_dummy where a <= 10;
    
             A B
    ---------- ----------
             1 hi
             2 hi
             3 hi
             4 hi
             5 hi
             6 hi
             7 hi
             8 hi
             9 hi
            10 hi
    
    10 rows selected.
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 2533004807
    
    -----------------------------------------------------------------------------
    | Id  | Operation         | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    -----------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |         |    10 |    60 |     3   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| R_DUMMY |    10 |    60 |     3   (0)| 00:00:01 |
    -----------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - filter("A"<=10)
    
    
    Statistics
    ----------------------------------------------------------
              0  recursive calls
              0  db block gets
              8  consistent gets
              0  physical reads
              0  redo size
            329  bytes sent via SQL*Net to client
            238  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
             10  rows processed
    As expected under its weight "Full Table Scan", now if I have an index on columns (a, b), if my interpretation is correct, according to the docs, the optimizer should not do a "full Index scan", but Interestingly, it obeys the indication of index_ffs and did a full scan index
    SQL> create index r_dummy_idx on r_dummy(a,b);
    
    Index created.
    
    SQL> exec dbms_stats.gather_index_stats('HLODS','R_DUMMY_IDX');
    
    PL/SQL procedure successfully completed.
    
    SQL> select /*+index_ffs(r)*/ * from r_dummy r where a <= 10;
    
             A B
    ---------- ----------
             1 hi
             2 hi
             3 hi
             4 hi
             5 hi
             6 hi
             7 hi
             8 hi
             9 hi
            10 hi
    
    10 rows selected.
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3219236618
    
    ------------------------------------------------------------------------------------
    | Id  | Operation            | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT     |             |    10 |    60 |     2   (0)| 00:00:01 |
    |*  1 |  INDEX FAST FULL SCAN| R_DUMMY_IDX |    10 |    60 |     2   (0)| 00:00:01 |
    ------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - filter("A"<=10)
    
    
    Statistics
    ----------------------------------------------------------
              1  recursive calls
              0  db block gets
              4  consistent gets
              0  physical reads
              0  redo size
            330  bytes sent via SQL*Net to client
            238  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
             10  rows processed
    This clearly shows the optimizer chooses 'INDEX FAST FULL SCAN' even though none of the indexed columns have 'NOT NULL' constraint.

    And there is another statement that talks about the results of the COMMAND.

    + "May not be used to eliminate a sort operation, because data are not classified by the index key ' +.

    He eliminated the sort operation, I see my results in ascending order.
    SQL> drop table r_dummy;
    
    Table dropped.
    
    SQL> create table r_Dummy(a number);
    
    Table created.
    
    SQL> insert into r_dummy values(10);
    
    1 row created.
    
    SQL> insert into r_dummy values(3);
    
    1 row created.
    
    SQL> insert into r_dummy values(1);
    
    1 row created.
    
    SQL> insert into r_dummy values(9);
    
    1 row created.
    
    SQL> insert into r_dummy values(5);
    
    1 row created.
    
    SQL> insert into r_dummy values(4);
    
    1 row created.
    
    SQL> insert into r_dummy values(2);
    
    1 row created.
    
    SQL> insert into r_dummy values(6);
    
    1 row created.
    
    SQL> insert into r_dummy values(7);
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select * from r_dummy;
    
             A
    ----------
            10
             3
             1
             9
             5
             4
             2
             6
             7
    
    9 rows selected.
    
    SQL> create index r_dummy_idx on r_dummy(a);
    
    Index created.
    
    SQL> set autotrace on;
    SQL> exec dbms_stats.gather_table_stats('HLODS','R_DUMMY');
    
    PL/SQL procedure successfully completed.
    
    SQL> exec dbms_stats.gather_index_stats('HLODS','R_DUMMY_IDX');
    
    PL/SQL procedure successfully completed.
    Below you can see the results in ascending order.
    SQL> select /*+index_ffs(r)*/ * from r_dummy r where a<=10;
    
             A
    ----------
             1
             2
             3
             4
             5
             6
             7
             9
            10
    
    9 rows selected.
    
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3219236618
    
    ------------------------------------------------------------------------------------
    | Id  | Operation            | Name        | Rows  | Bytes | Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT     |             |     9 |    27 |     2   (0)| 00:00:01 |
    |*  1 |  INDEX FAST FULL SCAN| R_DUMMY_IDX |     9 |    27 |     2   (0)| 00:00:01 |
    ------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       1 - filter("A"<=10)
    
    
    Statistics
    ----------------------------------------------------------
              1  recursive calls
              0  db block gets
              4  consistent gets
              0  physical reads
              0  redo size
            291  bytes sent via SQL*Net to client
            238  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              9  rows processed
    
    SQL>
    I am not sure if the docs are wrong or I'm reading wrong. Please help / correct me if my interpretation is poor.

    RUSSO says:
    Nicosa salvation,
    First of all, thank you for your elaborate explanation.

    Nicosa wrote:
    Will rely on data to order no order by clause and your app will be one day or the other have a bug. + (which, in fact, will not one, as the app has been designed in this way!) +

    I don't really do this, I know that even in parallel the same query may return also rows without a prescription. But was surprised to see my results neatly on INDEX NORMAL (non-partitioned). However, I make sure that I have use 'order by' when I want my results to order.

    But still I'm not sure, how the absence of constraint column 'NOT NULL' in the index would stop optimizer to do a full scan limited index

    Oracle does not index lines where all coluumns in the index are null. So, in your first example it could be possible that there is a line wiith the two a and b null. Oracle could not return this line using an index full assessment because it would not be in the index. However, by adding a predicate on a indexed columns say you actually column is not null.

    In the table, that I used in my example above, all three columns are nullable. Take into account:

    SQL> select acctno, count(*) from pttrans
      2  group by acctno;
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3294770776
    
    --------------------------------------------------------------------------------------
    | Id  | Operation          | Name    | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    --------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |         |   532K|  6239K|       | 48143   (2)| 00:09:38 |
    |   1 |  HASH GROUP BY     |         |   532K|  6239K|   107M| 48143   (2)| 00:09:38 |
    |   2 |   TABLE ACCESS FULL| PTTRANS |  5081K|    58M|       | 37895   (1)| 00:07:35 |
    --------------------------------------------------------------------------------------
    
    SQL> select acctno, count(*) from pttrans
      2  where acctno is not null
      3  group by acctno;
    
    Execution Plan
    ----------------------------------------------------------
    Plan hash value: 3737827862
    
    ------------------------------------------------------------------------------------------
    | Id  | Operation             | Name     | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |
    ------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT      |          |   532K|  6239K|       | 20641   (4)| 00:04:08 |
    |   1 |  HASH GROUP BY        |          |   532K|  6239K|   107M| 20641   (4)| 00:04:08 |
    |*  2 |   INDEX FAST FULL SCAN| PTTRANS1 |  5081K|    58M|       | 10393   (2)| 00:02:05 |
    ------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
    
       2 - filter("ACCTNO" IS NOT NULL)
    

    The first query must examine acctno null to get the correct number, but the second, because I asked explicitly not null can use the index.

    John

  • Table MC AS3 n00b question

    OK I loaded xml in video clips created dynamically, and when the user clicks on these other dynamically created clips video clip appears with more info loaded in XML. My question is how can I go back the information individually for each clip instead of all at once. My code:

    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.display.MovieClip;
    import flash.text.TextField;
    import flash.events.MouseEvent;

    var theXml:XML;
    var loader: URLLoader = new URLLoader();
    var mcArray:Array = new Array();
    var boxArray:Array = new Array();
    Loader.Load (new URLRequest ("template.xml"));
    loader.addEventListener (Event.COMPLETE, loadXML);
    function loadXML(e:Event):void
    {
    Check = new XML (e.target.data);
    for (var i: Number = 0; i < theXml.name.length (); i ++)
    {
    var theMC:MovieClip = new MovieClip();
    var theText:TextField = new TextField();
    theText.text = theXml.name [i]. @ Title;
    theText.x = 20;
    theText.y = 40;
    theText.selectable = false;
    theMC.addChild (theText);
    theMC.graphics.beginFill (0xff0000);
    theMC.graphics.drawCircle (50,50,50);
    theMC.graphics.endFill ();
    theMC.x = theMC.width * i;
    theMC.name = "mc" + i;
    mcArray.push (theMC);
    mcArray [i] .addEventListener (MouseEvent.CLICK, moClick);

    var descBox:MovieClip = new MovieClip();
    var descText:TextField = new TextField();
    descText.height = 100;
    descBox.graphics.beginFill (0xff0000);
    descBox.graphics.drawRoundRect (0,0,100,200,10,10);
    descBox.graphics.endFill ();
    descBox.name = 'box' + i;
    descBox.addChild (descText);
    boxArray.push (descBox);
    mcArray [i] .addChild (boxArray [i]);
    descText.text = theXml.name [i]. @ Title + ":"+ theXml.name [i]; ".
    boxArray [i] = mcArray [i] there .height-70;
    boxArray [i] .visible = false;
    addChild (mcArray [i]);

    }

    function moClick(e:MouseEvent)
    {

    / * If I try to put a loop here obviously it would display all and when I try to target by e.currentTarget.boxArray [n] .visible = true;

    its not able to find the properties in the table and get the error:

    TypeError: Error #1010: a term is undefined and has no properties.

    to MethodInfo - 1)

    */


    }
    }

    Any help would be greatly appreciated, thank you!

    Load the data separately only must not serious.  I don't see a reason why you want to put a loop in the event handler.  If you add a descBox as a child of each object in mcArray, then you should be able to target the descBox using his name, but I would just change the name to be 'box' for each of them so that you can use the following syntax...

    MovieClip (event.currentTarget) .getChildByName ('box');

    That should be the object descBox, you have added as a child object theMC as long as you assign it the 'name' box (instead of 'box ' + i).

Maybe you are looking for