query not using the index for some user

Hello

I have a query that is running in less than a second for sys, system, or schema owner. However, another user (test_user) take 30 seconds to run the same query.

I certainly dba and privileges identical to test_user as schmea_user, but the result is the same.

I checked

Select * from V$ SYS_OPTIMIZER_ENV;

Both are the same for both users.

I have check the plan to explain to both users. I noticed that for sys/system/schema_owner, the query uses an index, but not the test_user.

All have experience the issue where a user uses an index, but not the other?

Thank you for any assistance.

Thank you for the display of formatting output, this output is much easier to read.

One of the first things you notice about the execution plans that is for the owner non-schema "SQL_ID, 0wcs85uywn72m, number of children 1" appears in the output of DBMS_XPLAN, while "SQL_ID 0wcs85uywn72m, child number 0" (the same SQL_ID but a different number of child) appears for the schema owner. "" Whereas the SQL_ID is the same, which indicates that the client requires exactly the same SQL statement, so it's a good start.

Then, note that in the predicate for the nonschema owner information section the following appears (sometimes with the order of the two conditions switched in position) as a condition placed on each table that is available in the schema:

filter(("SEAL_FLAG" IS NULL OR "SEAL_FLAG"'Y'))

The above suggests the presence of the virtual private database (or a superset of private database virtual) generated the predicates. You should be able to confirm that this is the case by querying V$ VPD_POLICY using the SQL_ID which was displayed in the DBMS_XPLAN output:

SELECT
  *
FROM
  V$VPD_POLICY
WHERE
  SQL_ID='0wcs85uywn72m';

As a test, I made a few minor adjustments to the example on this page:
http://Antognini.ch/2011/09/optimizer_secure_view_merging-and-VPD/
I changed the name of T to T12 and TESTUSER table specified for the schema names. I then created the function S of this page as follows:

CREATE OR REPLACE FUNCTION s (schema IN VARCHAR2, tab IN VARCHAR2) RETURN VARCHAR2 AS
BEGIN
  RETURN 'ID < 10';
END;
/

I then added a couple of lines in the T12 test table:

INSERT INTO T12 VALUES (1,1,NULL);
INSERT INTO T12 VALUES (4,1,NULL);
INSERT INTO T12 VALUES (10,1,NULL);
INSERT INTO T12 VALUES (12,1,NULL);

COMMIT;

With an active 10053 trace, I executed the following SQL statement:

SELECT id, pad
  FROM t12
  WHERE
  spy(id, pad) = 1

The SQL_ID (in my case, found in the 10053 trace file) was 6hqw5p9d8g8wf, so I checked V$ VPD_POLICY to this SQL_ID:

SELECT
  *
FROM
  V$VPD_POLICY
WHERE
  SQL_ID='6hqw5p9d8g8wf';

ADDRESS          PARADDR            SQL_HASH SQL_ID        CHILD_NUMBER OBJECT_OWNER OBJECT_NAME                    POLICY_GROUP                   POLICY                 POLICY_FUNCTION_OWNER          PREDICATE
---------------- ---------------- ---------- ------------- ------------ ------------ ------------------------------ ------------------------------ ---------------------- ------------------------------ ------------------------------------------------------------------------------------
000007FFB7701608 000007FFB7743350 1518838670 6hqw5p9d8g8wf            0 TESTUSER     T12                            SYS_DEFAULT                    T_SEC                  TESTUSER                       ID < 10

As noted above, the VPD test function named S added the predicate "ID".< 10"="" to="" the="" sql="">

There are not many clues in the 10053 trace file in my test VPD generated additional predicates. Trace the following was found shortly after the beginning of the file (this is the SQL statement initially presented):

----- Current SQL Statement for this session (sql_id=6hqw5p9d8g8wf) -----
SELECT id, pad
  FROM t12
  WHERE
  spy(id, pad) = 1

I searched then down in the trace for final after changes query file (to be noted that this sentence could be slightly different in different versions of database Oracle). That's what I found:

Final query after transformations: ******* UNPARSED QUERY IS *******
SELECT "T12"."ID" "ID","T12"."PAD" "PAD" FROM "TESTUSER"."T12" "T12" WHERE "TESTUSER"."SPY"("T12"."ID","T12"."PAD")=1 AND "T12"."ID"<10
kkoqbc: optimizing query block SEL$F5BB74E1 (#0)

Note that the final query after transformation shows how the final version of the query that has been rewritten by the query optimizer before the SQL statement has been executed and this version of the query includes AND "T12". "" IDENTITY CARD ".<10. if="" i="" was="" attempting="" to="" determine="" how="" that=""><10 predicate="" was="" added="" to="" the="" sql="" statement,="" i="" would="" start="" at="" the="" "current="" sql="" statement="" for"="" line="" in="" the="" trace="" file="" and="" search="" down="" the="" trace="" file="" for=""><10* -="" in="" this="" case,="" the="" following="" is="" what="" i="" found="" as="" the="" first="" search="" result,="" very="" close="" to="" the="" "current="" sql="" statement="" for"="" line="" in="" the="" trace="">

**************************
Predicate Move-Around (PM)
**************************
PM:     PM bypassed: Outer query contains no views.
PM:     PM bypassed: Outer query contains no views.
query block SEL$F5BB74E1 (#0) unchanged
FPD: Considering simple filter push in query block SEL$F5BB74E1 (#0)
"TESTUSER"."SPY"("T12"."ID","T12"."PAD")=1 AND "T12"."ID"<10
try to generate transitive predicate from check constraints for query block SEL$F5BB74E1 (#0)
finally: "TESTUSER"."SPY"("T12"."ID","T12"."PAD")=1 AND "T12"."ID"<10

As can be seen from the above (because the predicate again appeared before and after the line containing the word "Finally: '), the AND"T12 ". "" IDENTITY CARD ".<10 predicate="" was="" already="" added="" to="" the="" original="" sql="" statement="" by="" the="" time="" the="" predicate="" move-around="" section="" of="" the="" trace="" file="" was="" written,="" and="" that="" is="" the="" first="" mention="" of=""><10 in="" the="" trace="" file.="" in="" your="" case,="" you="" would="" search="" the="" 10053="" trace="" file="">

"SEAL_FLAG" IS NULL

If V$ VPD_POLICY revealed that there are virtual private database (VPD) generated predicates applied to the SQL statement, take a look at the following article in the Oracle documentation library:
http://docs.Oracle.com/CD/B28359_01/network.111/B28531/VPD.htm

This article lists the different points of view, who can be interviewed to learn more about the VPD rules which are in force in the schema. For example, with my SPV test:

SELECT
  *
FROM
  ALL_POLICIES;

OBJECT_OWNER                   OBJECT_NAME                    POLICY_GROUP                  POLICY_NAME                    PF_OWNER                       PACKAGE                       FUNCTION                       SEL INS UPD DEL IDX CHK ENA STA POLICY_TYPE              LON
------------------------------ ------------------------------ ----------------------------- ------------------------------ ------------------------------ ----------------------------- ------------------------------ --- --- --- --- --- --- --- --- ------------------------ ---
TESTUSER                       T12                            SYS_DEFAULT                   T_SEC                          TESTUSER                       S                                                            YES YES YES YES NO  NO  YES NO  DYNAMIC                  NO

He knows performance issues related to the use of VPD, some of which are Oracle Database version-dependent, and some have been fixed in recent versions. Take a look at the following articles if you have access to My Oracle Support:
MetaLink (MOS) Doc ID 728292.1 ' known performance problems when you use transparent encryption data and indexes on the encrypted columns.
MetaLink (MOS) Doc ID 967042.1 "How to investigate Query Performance regressions Caused by VPD (FGAC) predicates?"

You might find working through the second of the above that the problem is caused by a bug in database Oracle.

On a side note. Execution plans you have published include the 0 value in the column starts many of the operations in the execution plan. 0 indicates that the operation never actually executed. A 0 is included in the column starts on the line that includes the FULL ACCESS of TABLE of PEOPLE_TRANSACTIONS at least to the OPC. Value 123, a full table of PEOPLE_TRANSACTIONS table scan PROPERTY_CONTAINER_ID was not actually performed.

Charles Hooper
http://hoopercharles.WordPress.com/
IT Manager/Oracle DBA
K & M-making Machine, Inc.

Tags: Database

Similar Questions

  • Query is not using the index. (Included execution plan. TKPROF output not available)

    Hi all

    Version of DB: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod

    Here is the description of the problem:
    (The statistics are up to date for all tables).

    The query below does not use the index on ACCOUNTS_LIVE (ID). (Unique index)
    SQL> explain plan for
      2  select txn.account_number,to_number(txn.amount_lcy) txn_amt,to_date(booking_date,'YYYYMMDD') TXN_DATE,
      3        sal.latest_sal,sal.sal_date,customer_name,employer_name,
      4       decode(COMMUNICATION_TYPE_1,'MOBILE',COMMUNICATION_NO_1,
      5            decode(COMMUNICATION_TYPE_2,'MOBILE',COMMUNICATION_NO_2)) mob,
      6       txn.CURRENCY, CHEQUE_NUMBER,trans_dets,trans_reference,target,teller_id,acc.category,acc.inactive_marker,
      7            acc.posting_restrict,cus.sector,cus.industry
      8  from coreadmin.Gtxn_dtl_v1 txn,
      9                     (select account_number,round(to_number(nvl(amount_lcy,0)),2) latest_sal,TXN_DATE sal_date,rr
     10                      from
     11                        (select to_date(booking_date,'YYYYMMDD') TXN_DATE,batch_id,account_number,amount_lcy
     12                             ,row_number() over (partition by account_number
     13                                                     order by to_date(booking_date,'YYYYMMDD') desc NULLS LAST,
     14                                                     batch_id desc nulls last) rr,
     15                                     CURRENCY, CHEQUE_NUMBER,trans_dets,trans_reference
     16                             from coreadmin.Gtxn_dtl_v1
     17                             where transaction_code in ('204','938')
     18                  and to_number(amount_lcy) > 0)
     19                             where rr = 1
     20                       ) sal,accounts_live acc,customers_live cus
     21  where to_date(booking_date,'YYYYMMDD') between to_date('030109','DDMMRR') and to_date('020209','DDMMRR')
     22  and txn.account_number = sal.account_number
     23  and txn.account_number = acc.id
     24  and txn.CUSTOMER_ID = cus.CUSTOMER_number
     25  and target in ('30','31','32')
     26  /
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT                                                                                                                                     
    ------------------------------------------------------------------------------------------------------------------------------------------------------
    Plan hash value: 920245766                                                                                                                            
                                                                                                                                                          
    -----------------------------------------------------------------------------------------------------------                                           
    | Id  | Operation                        | Name           | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |                                           
    -----------------------------------------------------------------------------------------------------------                                           
    |   0 | SELECT STATEMENT                 |                |   363M|   121G|       |   223K  (4)| 00:44:47 |                                           
    |*  1 |  HASH JOIN                       |                |   363M|   121G|  6232K|   223K  (4)| 00:44:47 |                                           
    |*  2 |   VIEW                           |                | 34453 |  5820K|       |   147K  (1)| 00:29:36 |                                           
    |*  3 |    WINDOW SORT PUSHED RANK       |                | 34453 |  1480K|  4072K|   147K  (1)| 00:29:36 |                                           
    |*  4 |     FILTER                       |                |       |       |       |            |          |                                           
    |   5 |      INLIST ITERATOR             |                |       |       |       |            |          |                                           
    |*  6 |       TABLE ACCESS BY INDEX ROWID| GTXN_DTL_V1    | 34453 |  1480K|       |   147K  (1)| 00:29:31 |                                           
    |*  7 |        INDEX RANGE SCAN          | IDX_TXN5       |   707K|       |       |  1815   (2)| 00:00:22 |                                           
    |*  8 |   HASH JOIN                      |                |   598K|   106M|    20M| 63724   (1)| 00:12:45 |                                           
    |*  9 |    MAT_VIEW ACCESS FULL          | CUSTOMERS_LIVE |   227K|    17M|       |  2239   (4)| 00:00:27 |                                           
    |* 10 |    HASH JOIN                     |                |   598K|    59M|  9504K| 57157   (1)| 00:11:26 |                                           
    |  11 |     MAT_VIEW ACCESS FULL         | ACCOUNTS_LIVE  |   249K|  6577K|       |  1832   (2)| 00:00:22 |                                           
    |* 12 |     TABLE ACCESS BY INDEX ROWID  | GTXN_DTL_V1    |   597K|    43M|       | 52319   (1)| 00:10:28 |                                           
    |* 13 |      INDEX RANGE SCAN            | IDX_TXN11_V1   |  1204K|       |       |  3931   (2)| 00:00:48 |                                           
    -----------------------------------------------------------------------------------------------------------                                           
                                                                                                                                                          
    Predicate Information (identified by operation id):                                                                                                   
    ---------------------------------------------------                                                                                                   
                                                                                                                                                          
       1 - access("TXN"."ACCOUNT_NUMBER"="ACCOUNT_NUMBER")                                                                                                
       2 - filter("RR"=1)                                                                                                                                 
       3 - filter(ROW_NUMBER() OVER ( PARTITION BY "ACCOUNT_NUMBER" ORDER BY                                                                              
                  TO_DATE("BOOKING_DATE",'YYYYMMDD') DESC  NULLS LAST,INTERNAL_FUNCTION("BATCH_ID") DESC  NULLS                                           
                  LAST)<=1)                                                                                                                               
       4 - filter(TO_DATE('030109','DDMMRR')<=TO_DATE('020209','DDMMRR'))                                                                                 
       6 - filter(TO_NUMBER("AMOUNT_LCY")>0)                                                                                                              
       7 - access("TRANSACTION_CODE"='204' OR "TRANSACTION_CODE"='938')                                                                                   
       8 - access("TXN"."CUSTOMER_ID"="CUS"."CUSTOMER_NUMBER")                                                                                            
       9 - filter("TARGET"='30' OR "TARGET"='31' OR "TARGET"='32')                                                                                        
      10 - access("TXN"."ACCOUNT_NUMBER"="ACC"."ID")                                                                                                      
      12 - filter("TXN"."CUSTOMER_ID" IS NOT NULL)                                                                                                        
      13 - access(TO_DATE("BOOKING_DATE",'YYYYMMDD')>=TO_DATE('030109','DDMMRR') AND                                                                      
                  TO_DATE("BOOKING_DATE",'YYYYMMDD')<=TO_DATE('020209','DDMMRR'))                                                                         
    
    38 rows selected.
    
    SQL> select index_name
      2  from dba_ind_columns
      3  where table_name = 'ACCOUNTS_LIVE'
      4  and column_name = 'ID';
    
    INDEX_NAME                                                                                                                                            
    ------------------------------                                                                                                                        
    IDX_ACCLIVE                                                                                                                                           
    Line 23 of the query uses accounts_live.id.

    11 the order ID explain plan shows that the index does not use.

    Please suggest.

    Thanks in advance,
    Jac

    What happens when you force the index by using hint and use the hash between txn and acc join?

    See you soon
    Sarma.

  • HP M477fdn printers have been impossible to install the driver for some users. We receive the error message following '0 x 00000006 '.

    have been unable to install the driver for some users. We do not receive the following error message.

    Error: 0 x 00000006

    Hi Sameer,

    Thanks for posting your query on the Microsoft Community.

    According to the description, I understand that you are getting an error code.

    I would like to know some information.

    1. You are connected to a domain network?

    2. When exactly do you get this error code?

    3. Do you also have any error message?

    This problem may occur if the print spooler service is stopped.

    To start the spooler service, follow these steps:

    1. click on Startand then click Control Panel.

    2. double-click Administrative Toolsand then click Services.

    3. double-click on the Printer Spooler service and then change the startup type to Automatic. This option sets the spooler service starts automatically when you restart the computer.

    4. If you want to start the spooler service immediately, click Start in the area of The State of the Service .

    I would also refer to the Microsoft Help Article below and check if that helps.

    http://Windows.Microsoft.com/en-us/Windows/printer-problems-in-Windows-help#fix-printer-problems=Windows-7&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1

    Hope this information helps. Please let us know if you need any other help with Windows in the future. We will be happy to help you.

  • I have a network drive. & Passwords, I want to force their users to log in there every time and do not use the last name of user and password.

    I have a network (an Iomega iconnect nas) drive. I want to force their users to log in there every time and do not use the last name of user and password. They can change it in control of card-how can I make sure they. I'm only using Windows 7 as standalones (with lan), there is no server connection

    Hello

    I suggest you post the same question in the TechNet forum and check if it helps.

    http://social.technet.Microsoft.com/forums/en-us/w7itpronetworking/threads

  • I signed up for 30 day trial and I just got a notification if the trial ended. I did not use the system for more than 30 minutes.

    I signed up for a 30 day trial and I just got a notification if the trial ended. I did not use the system for more than 30 minutes.

    http://helpx.Adobe.com/x-productkb/global/trial-software-expired-early.html

  • does not use the INDEX

    I have problem with a query as follows. It does not index when I keep a function on the left side of the comparison in which the condition.

    But when I remove the function is using the index.

    With BLC AS 
    Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     ID                                        NOT NULL NUMBER
     MASTER_VALUE               NOT NULL NUMBER(8)
     DESC_TEXT_ID                                    NUMBER
     GVM                                                     VARCHAR2(50)
     MASTER_LOOKUP_ID    NOT NULL  NUMBER
     WORK_SECTION_ID                          NUMBER
     AUDIT_TRAIL_NO                              NUMBER
     
    
    SQL> SELECT COUNT(*) FROM BLC;
      COUNT(*)
    ----------
          7769
    
    SQL> SELECT COUNT(DISTINCT(GVM)) "distinct" FROM BLC;
      distinct
    ----------
          1350
    
    SQL> SELECT COUNT(*) "nulls" FROM BLC WHERE GVM IS NULL;
    
         nulls
    ----------
          6419
    
    SQL> SELECT COLUMN_NAME,INDEX_NAME FROM DBA_IND_COLUMNS WHERE TABLE_NAME='BLC';
    
    COLUMN_NAME                              INDEX_NAME
    ---------------------------------------- ------------------------------
    MASTER_LOOKUP_ID      LKPCDE_MSTLKP_FK_I
    WORK_SECTION_ID        LKPCDE_WRKSEC_FK_I
    GVM                                   LKPCDE_UK
    MASTER_VALUE              LKPCDE_MASTERID_VALUE_UK
    MASTER_LOOKUP_ID     LKPCDE_MASTERID_VALUE_UK
    ID                                       LKPCDE_PK
    
    SQL> EXPLAIN PLAN FOR SELECT ID FROM BLC WHERE UPPER ( GVM) = 'MAIN_ORG';
    Explained.
    SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 3196655606
    --------------------------------------------------------------------------------------
    | Id  | Operation         | Name             | Rows  | Bytes | Cost (%CPU)| Time|
    --------------------------------------------------------------------------------------
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |                  |    78 |   624 |    18   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| BLC |    78 |   624 |    18   (0)| 00:00:01 |
    --------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    -----------------------------------------------------------------------------------------------------------------------------------
       1 - filter(UPPER("GVM")='MAIN_ORG')
    13 rows selected.
    
    
    SQL> EXPLAIN PLAN FOR SELECT ID FROM BLC WHERE GVM
      = 'MAIN_ORG';
    Explained.
    SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 1620245961
    --------------------------------------------------------------------------------
    ----------------
    | Id  | Operation                   | Name             | Rows  | Bytes | Cost (%
    CPU)| Time     |
    --------------------------------------------------------------------------------
    ----------------
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT            |                  |     1 |     8 |     2
     (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| BLC |     1 |     8 |     2
     (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN         | LKPCDE_UK        |     1 |       |     1
     (0)| 00:00:01 |
    --------------------------------------------------------------------------------
    ----------------
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       2 - access("GVM"='MAIN_ORG')
    14 rows selected.
    
    SQL> EXPLAIN PLAN FOR SELECT /* INDEX(LKPCDE_UK) */ ID FROM BLC WHE
    RE UPPER ( GVM ) = 'MAIN_ORG';
    Explained.
    SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    Plan hash value: 3196655606
    --------------------------------------------------------------------------------
    ------
    | Id  | Operation         | Name             | Rows  | Bytes | Cost (%CPU)| Time
         |
    --------------------------------------------------------------------------------
    ------
    
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT  |                  |    78 |   624 |    18   (0)| 00:0
    0:01 |
    |*  1 |  TABLE ACCESS FULL| BLC |    78 |   624 |    18   (0)| 00:0
    0:01 |
    --------------------------------------------------------------------------------
    ------
    
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
    --------------------------------------------------------------------------------
    ---------------------------------------------------
       1 - filter(UPPER("GVM")='MAIN_ORG')
    13 rows selected.
    

    Please let me know how I can force it to use an index as it is causing the CPU usage.

    I can't change the query in the application it is used in several places.

    Thank you

    And/or read: ORACLE-BASE - Oracle function index

  • If the INSTR function will not use the INDEX o?

    Hi all


    I have a querry as
        Select * from Tab1 Where Instr(Tab1.Col1,'XX') >0 ;
    Is simple index on column Col1. If we use the index will be used or full table scan will happen in this scenario?

    Please give me explanatory answer because I have doubts


    Dhabas

    Hello

    You must use the index function if you want to avoid the full table scan. Check this box

    SQL> create table tab1(col1 varchar(20))
      2  /
    
    Table created.
    
    SQL> insert into tab1 values ('XXAB')
      2  /
    
    1 row created.
    
    SQL> create index col1_idx on tab1(col1);
    
    Index created.
    
    SQL> explain plan for Select * from Tab1 Where Instr(Tab1.Col1,'XX') >0;
    
    Explained.
    
    SQL> set autotrace on
    SQL> Select * from Tab1 Where Instr(Tab1.Col1,'XX') >0;
    XXAB
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=5 Card=1 Bytes=12)
       1    0   TABLE ACCESS (FULL) OF 'TAB1' (TABLE) (Cost=5 Card=1 Bytes
              =12)
    
    Statistics
    ----------------------------------------------------------
              4  recursive calls
              0  db block gets
             32  consistent gets
              0  physical reads
              0  redo size
            234  bytes sent via SQL*Net to client
            280  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    
    SQL>  create index col1_idx2 on tab1(Instr(Col1,'XX'));
    
    Index created.
    
    SQL> Select * from Tab1 Where Instr(Tab1.Col1,'XX') >0;
    XXAB
    
    Execution Plan
    ----------------------------------------------------------
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=2 Card=1 Bytes=12)
       1    0   TABLE ACCESS (BY INDEX ROWID) OF 'TAB1' (TABLE) (Cost=2 Ca
              rd=1 Bytes=12)
    
       2    1     INDEX (RANGE SCAN) OF 'COL1_IDX2' (INDEX) (Cost=1 Card=1
              )
    
    Statistics
    ----------------------------------------------------------
             28  recursive calls
              0  db block gets
             22  consistent gets
              0  physical reads
              0  redo size
            234  bytes sent via SQL*Net to client
            280  bytes received via SQL*Net from client
              2  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
              1  rows processed
    
    SQL> 
    

    Thank you
    AJ

  • Setting the query: optimizer does not use the index function

    Hello

    I have a request written by a developer that I can't change.

    It is here that the condition:

    (   UPPER(TRIM (CODFSC)) = UPPER (TRIM ( '01923980500'))

           OR UPPER(TRIM (CODUIC)) = UPPER (TRIM ( '01923980500')))

    There is an index on CODFSC and on CODUIC1.

    the plan is:

    Plan

    INSTRUCTION SELECT ALL_ROWS cost: 9 194 bytes: 3 206 502 cardinality: 15 054

    ACCESS FULL ANAGRAFICA cost TABLE TABLE 1: 9 194 bytes: 3 206 502 cardinality: 15 054

    So I created two new index on SUPERIOR (TRIM ()CODFSC)) and SUPERIOR (TRIM ()CODUIC)) but the plan

    complete analysis of STIL.

    Modifing where condition in:

    (   CODFSC = UPPER (TRIM ( '01923980500'))

           OR CODUIC = UPPER (TRIM ( '01923980500')))

    the plan is:

    SELECT STATEMENT ALL_ROWSCost: 157 bytes: 426 cardinality: 2

    CONCATENATION OF 5

    TABLE ACCESS BY INDEX ROWID ANAGRAFICA cost TABLE 2: cardinality of 5 bytes: 213: 1

    1 INDEX RANGE SCAN INDEX ANAGRAFICA_IDX01 cost: cardinality 3: 1

    TABLE ACCESS BY INDEX ROWID ANAGRAFICA cost TABLE 4: cardinality 152 bytes: 213: 1

    3 INDEX SKIP SCAN INDEX ANAGRAFICA_IDX02 cost: cardinality 1: 151

    Why optimizer not use my funct index?

    Thank you.

    Franck,

    I always forget that the default value for the GOLD expansion depends on a path indexed for each branch.

    2 in your use of or_predicates (2) depends on the position of complex predicate which must be expanded.  If you change the order of predicate 'State = 0' to display AFTER the complex predicate, you must change the indicator of "or_predicates (1).

    Outside of the current state of undocumented indicator, it also introduces the disturbing thought that, for a more complex query, a change in the transformation may result in another set of query blocks generated with a different ranking of the predicates. Yet another case to ensure that if you suggest anything suggest you (or create a SQL database).

    Concerning

    Jonathan Lewis

  • Do not use the index

    Hi all
    DB version is 10.2.0.4
    Have a query as below
    SQL> explain plan for SELECT GS.LOT_NO , GS.LOT_ID , ILI.ITEM_ID ITEM_ID,
      2               GR.RESULT_VALUE_CHAR QUALITATIVE_VALUE , ITM.ITEM_NO FROM
                 GMD_QC_TESTS GQT, GMD_RESULTS GR, GMD_SAMPLES GS , IC_LOCT_INV
      3    4               ILI, IC_ITEM_MST_B ITM WHERE GQT.TEST_CODE = 'ISON' AND
      5               GR.TEST_ID = GQT.TEST_ID AND GR.RESULT_VALUE_CHAR LIKE :B3
      6               ||'-'||:B2 ||'%' AND GR.SAMPLE_ID = GS.SAMPLE_ID AND ITM.ITEM_ID
      7               = GS.ITEM_ID AND ILI.WHSE_CODE = UPPER(:B1 ) AND ILI.ITEM_ID =
      8               GS.ITEM_ID AND ILI.LOT_ID = GS.LOT_ID AND ILI.LOCT_ONHAND > 0
      9               AND ILI.LOT_ID > 0 AND ILI.LOT_STATUS = 'GOOD' AND NOT EXISTS (
     10               SELECT 1 FROM IC_TRAN_PND ITP WHERE ITP.LOT_ID = GS.LOT_ID AND
     11               ITP.ITEM_ID = GS.ITEM_ID AND ITP.DELETE_MARK = 0 AND
     12               ITP.DOC_TYPE = 'OMSO' AND ITP.WHSE_CODE = UPPER(:B1 ) AND LOT_ID
     13               <> 0 ) ORDER BY 4
     14  /
    
    Explained.
    
    SQL> select * from table(dbms_xplan.display);
    
    PLAN_TABLE_OUTPUT
    ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Plan hash value: 2952119331
    
    ---------------------------------------------------------------------------------------------------------
    | Id  | Operation                          | Name               | Rows  | Bytes | Cost (%CPU)| Time     |
    ---------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT                   |                    |    55 |  7095 | 13614   (1)| 00:02:51 |
    |   1 |  SORT ORDER BY                     |                    |    55 |  7095 | 13614   (1)| 00:02:51 |
    |   2 |   NESTED LOOPS ANTI                |                    |    55 |  7095 | 13613   (1)| 00:02:51 |
    |   3 |    NESTED LOOPS                    |                    |    55 |  5940 | 13393   (1)| 00:02:49 |
    |*  4 |     HASH JOIN                      |                    |    55 |  4730 | 13283   (1)| 00:02:47 |
    |*  5 |      TABLE ACCESS BY INDEX ROWID   | IC_LOCT_INV        | 17498 |   410K|  4056   (1)| 00:00:51 |
    |*  6 |       INDEX RANGE SCAN             | IC_LOCT_INV_I1     | 52570 |       |   137   (0)| 00:00:02 |
    |*  7 |      HASH JOIN                     |                    | 14944 |   904K|  9226   (1)| 00:01:56 |
    |   8 |       NESTED LOOPS                 |                    | 14944 |   452K|   212   (0)| 00:00:03 |
    |   9 |        NESTED LOOPS                |                    |     1 |    19 |     2   (0)| 00:00:01 |
    |  10 |         TABLE ACCESS BY INDEX ROWID| GMD_QC_TESTS_B     |     1 |    12 |     2   (0)| 00:00:01 |
    |* 11 |          INDEX UNIQUE SCAN         | GMD_QC_TESTS_B_U1  |     1 |       |     1   (0)| 00:00:01 |
    |* 12 |         INDEX UNIQUE SCAN          | GMD_QC_TESTS_TL_PK |   508 |  3556 |     0   (0)| 00:00:01 |
    |  13 |        TABLE ACCESS BY INDEX ROWID | GMD_RESULTS        | 14944 |   175K|   210   (0)| 00:00:03 |
    |* 14 |         INDEX RANGE SCAN           | GMD_RESULTS_N3     |   228 |       |     3   (0)| 00:00:01 |
    |* 15 |       TABLE ACCESS FULL            | GMD_SAMPLES        |  1642K|    48M|  9007   (1)| 00:01:54 |
    |  16 |     TABLE ACCESS BY INDEX ROWID    | IC_ITEM_MST_B      |     1 |    22 |     2   (0)| 00:00:01 |
    |* 17 |      INDEX UNIQUE SCAN             | IC_ITEM_MST_B_PK   |     1 |       |     1   (0)| 00:00:01 |
    |* 18 |    TABLE ACCESS BY INDEX ROWID     | IC_TRAN_PND        |     1 |    21 |     4   (0)| 00:00:01 |
    |* 19 |     INDEX RANGE SCAN               | IC_TRAN_PNDI1      |     1 |       |     3   (0)| 00:00:01 |
    ---------------------------------------------------------------------------------------------------------
    In the table full scan that happens on GMD_SAMPLES. Lot_id is selected in this table. On this column, there are indexes in the table. But this is not used?
    SQL> select dbms_metadata.get_ddl('INDEX','GMD_SAMPLES_N3','GMD') from dual;
    
      CREATE INDEX "GMD"."GMD_SAMPLES_N3" ON "GMD"."GMD_SAMPLES" ("LOT_ID")
      PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
      STORAGE(INITIAL 131072 NEXT 131072 MINEXTENTS 1 MAXEXTENTS 2147483645
      PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
      TABLESPACE "APPS_TS_TX_DATA"
    How can I lower the cost of the query. ?. This query runs for more than two hours in the comic book...

    Thank you
    Baskar.l

    The counties to answer your question, now?
    LOT_ID returns 99 + % of the lines so Full Table Scan is 100% justified & more efficient execution plan

  • Could not open the xls for some reason any

    When I try to open a XLS file with numbers 3.6.1 I get the error message ' cannot be opened for some reason any. "

    I tried to change the type of file csv and txt but neither technique gives readable results.

    I also tried to fix HD Mac (in fact a SSD) with disk utility and reboot, but that did not help either.

    Thoughts?

    Dick

    Hi Dick,

    Change the extension (.csv or .txt) is not any change in the type of file.

    Assuming that, since you posted in the numbers for the Mac community and state what version 3.6.1 a number you're on a Mac (and not using iOS 8 on your iPad), you can try opening the file using LibreOffice or Apache OpenOffice. Both are free to download and use. If none of them opens the file, it is probably corrupted. If they can open the file, there may be a compatibility problem between this file and the numbers. Try registering LibreOffice or Apache OpenOffice (like a MS Excel file), then try opening thaat version saved in number.

    Kind regards

    Barry

  • Remove unwanted in table 2D lines not knowing the index for which you want to remove

    Hello!

    I'm new on Labview and I hope someone can help me with my problem.

    First import an Excel worksheet into a 2D-string table. For each row in the table, then I want to compare the data in a specific column (which is a date (timestamp)) with the current date. Lines containing a date with number less than today's date, I want to put in a new table and the rest I have no need.

    I managed to create a time stamp for today so that it matches the timestamp of Excel. But for comparison and the creation of a new part of table, I have no idea how do. I tried several ways with no luck at all (probably because I don't understand all the screws that I use).

    Happy for all the help I can get!

    You are on the right track! (although your attempt lists only the datetime values)

    What you need to add/change, it is the resulting table needs to be connected to the loop as a Shift register (with an initial empty table), and in the case you use either Build table to add the current line or send the non modified through.

    You'll probably want to send all through and not only the datetime value.

    You will probably need some tweak to use only the date, but similar to this:

    /Y

  • my system restore gives me an error message, I'm ready to just do a factory restore, but it will not accomplish the restoration for some reason any!

    I did somehow something wrong and all seeking a srnt file for me through my business network that I managed to sync all my files via Adobe reader that supports only those of the doc and therefore prevents me to open any file or program etc. of my application files.  I am at my wits end I need to this computer, I'm in the middle of the tender of work and my spec and plans are those files and also my full runs super slow or not at all, nothing wants to establish a connection - my home page, my Web browser is just nothing is right, so I just want to go back to the box start. HEPL!

    Hi stephen almond,.

    Thanks for posting that query you in Microsoft Communities. You are not able to perform the system restore. Provide the following information:

    ·         What version of the operating system is installed on the computer?

    ·         Did you do changes on the computer before the show?

    ·         You get the error message?

    ·         Work on a domain?

    Performs a search using the Microsoft safety scanner.

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    Answer with the information required to help more.

    Thank you.

  • Storage/not using the printer for a period of time extended

    I have a Photosmart 6520 printer which is not used for a period of 6 months each year.

    The last time, I removed the cartridges and stored in an airtight container. When the reactivation of the printer, it has no print at all, but after many attempts to clean and/or align the print heads, he is slowly back to normal operation.

    My question is: what is the best ink cartridges must be left in the printer or deleted during this period?

    It is best to leave them in the printer. Once these special cartridges have their orange shipcap removed, I always recommend to leave in the printer, if you go to the store for a while.

  • First CC still not not using the thm for DSLR timecode files?

    I'm looking to confirm that first Pro CC still does not use sidecar files mov Canon DSLR thm files to extract the time of day timecode when importing. I know PP CS6, it only did not. Just checking to see if it is always the case. All DSLR files import currently with 00:00:00:00 timecode as technically most DSLR cameras are not real timecode in the mov files.

    My solution to workaround for recent years was of qtChange allows to add time camera of day timecode files thm files before importing in first mov. It doesn't seem a big deal, but when sending the changes to a colorist, for example, they LIKE a kind of timecode to help their end. I should add that qtChange can also add a name of coil for mov files, which is an additional subtlety to the calibration software.

    It would be nice to skip this additional step before importing.

    I'm heading over to the wishlist now to request this feature in the future PP updates.

    Thank you!

    Billy

    THM files are not used by first Pro CC. You should always use something like qtChange to add a TC track that is appropriate in the MOV file.

  • BlackBerry Bold 9700 smartphones may not use the phone for voice

    I could use the phone to talk about yesterday, today, it looks like by clicking in the background and can not hear the other party. The appeal says connected. Email is ok, ok, ok ok BBM, just the voice Internet service SMS does not work.

    V5.0.0.442 (Platform 5.1.0.121)

    Recharged using BB Desktop software. Service provider indicates phone is probably failed.

    It's either a problem with the speaker of the device or the headphone jack.  Try plugging in a few times and then try a phone call without it.

Maybe you are looking for