Tuning Query with IN-Operator

Hi all,
I have to tune the statement below.
UPDATE TABLE_A A
SET A.FIELD1 =
(SELECT B.FIELD1 FROM TABLE_B B WHERE B.IDENTNO IN (A.IDENTNO, A.IDENTNO||'000')
There are indexes on identno on TABLE_A and TABLE_A
The subquery returns only one row. The query works, but not fast enough.
I tried to split the where condition to join it together again with a union like this
UPDATE TABLE_A A
SET A.FIELD1 =
(SELECT B.FIELD1 FROM TABLE_B B WHERE B.IDENTNO = A.IDENTNO
UNION
SELECT B.FIELD1 FROM TABLE_B B WHERE B.IDENTNO = A.IDENTNO||'000')
But the execution plan shows a full table scan for the second part of the union.
How can I tune this part ? With function based index ?
Thanks in advance.
Henning

Please see this thread
When your query takes too long ...
You need to make sure if your statistics are up to date. If not analyze the table.
It works for me,
SQL*Plus: Release 9.2.0.6.0 - Production on Tue May 31 17:10:38 2011
Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
Connected to:
Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP and Oracle Data Mining options
JServer Release 9.2.0.8.0 - Production
SQL> CREATE TABLE TABLE_A AS SELECT 1 field1,'1000' IDENTNO FROM dual;
Table created.
SQL> CREATE TABLE TABLE_B AS SELECT 1 field1,'1000000' IDENTNO FROM dual;
Table created.
SQL> CREATE INDEX idx13 ON table_B(IDENTNO);
Index created.
SQL> CREATE INDEX idx12 ON table_A(IDENTNO);
Index created.
SQL> set autotrace on
SQL> UPDATE TABLE_A A
  2     SET A.FIELD1 =
  3            (SELECT B.FIELD1
  4               FROM TABLE_B B
  5              WHERE B.IDENTNO IN (A.IDENTNO, A.IDENTNO || '000'));
1 row updated.
Execution Plan
   0      UPDATE STATEMENT Optimizer=CHOOSE
   1    0   UPDATE OF 'TABLE_A'
   2    1     TABLE ACCESS (FULL) OF 'TABLE_A'
   3    1     CONCATENATION
   4    3       TABLE ACCESS (BY INDEX ROWID) OF 'TABLE_B'
   5    4         INDEX (RANGE SCAN) OF 'IDX13' (NON-UNIQUE)
   6    3       TABLE ACCESS (BY INDEX ROWID) OF 'TABLE_B'
   7    6         INDEX (RANGE SCAN) OF 'IDX13' (NON-UNIQUE)
Statistics
          2  recursive calls
          2  db block gets
          8  consistent gets
          0  physical reads
        424  redo size
        353  bytes sent via SQL*Net to client
        432  bytes received via SQL*Net from client
          3  SQL*Net roundtrips to/from client
          2  sorts (memory)
          0  sorts (disk)
          1  rows processed
SQL>

Similar Messages

  • Abap MDM API query with OR operation

    Hi experts,
    not sure this is the proper section for the thread, anyway; dealing with ABAP MDM API, is there a way to build up a query which involves several clause in OR conjunction?
    This is the scenario: I've got to extract several items on the basis of exact product codes. Tipically, I've got huge vectors of hundreds of product codes; actually, I could easily retrieve data by looping over them and, for each code, perform a query on MDM via QUERY method building the clause as follows:
          ls_query-parameter_code  = 'MDMSRM_PART_NO'. "Field code
           ls_query-operator        = 'EQ'.   "Contains
           ls_query-dimension_type  = mdmif_search_dim_field.      "Fieldsearch
           ls_query-constraint_type = mdmif_search_constr_text.    "Text search 
           lv_text = wa_codes-product_code.
           GET REFERENCE OF lv_text INTO ls_query-value_low.
           APPEND ls_query TO lt_query.
    This will however result in hundreds of query in the LOOP itself.
    Is there any way to build a query with OR operators ?
    Thanks,
    M.

    Hi,
    I see you are not clearing your local structure "ls_query".  This could be reason of problem,  try this and let us know the result:
    DATA lt_query                  TYPE mdm_query_table.
    DATA ls_query                 TYPE mdm_query.
    DATA lv_search_text       TYPE string.
    DATA lt_result_set            TYPE mdm_search_result_table.
    DATA ls_result_set           LIKE LINE OF lt_result_set.
    Fill query structure with FIRST parameter
        ls_query-parameter_code  = 'Name'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = 'BMW'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    CLEAR ls_query.
    Fill query structure with SECOND parameter
        ls_query-parameter_code  = 'Model'.
        ls_query-operator        = 'CS'. 
        ls_query-dimension_type  = mdmif_search_dim_field.    
        ls_query-constraint_type = mdmif_search_constr_text.
        lv_search_text = '2009'.
        GET REFERENCE OF lv_search_text INTO ls_query-value_low.
        APPEND ls_query TO lt_query.
    CLEAR ls_query.
    Query on records (search for value 'BMW' model '2009' in table Products)
        CALL METHOD lr_api->mo_core_service->query
          EXPORTING
            iv_object_type_code = 'Products'                  
            it_query            = lt_query
          IMPORTING
            et_result_set       = lt_result_set.

  • Re-write query with ANY operator

    Hi,
    How to write the given query using 'ANY ' operator , I dont need to fetch to grade_master table twice in database, just need to fetch within the result set.
    SELECT dsg_code,dsg_name,dsg_grade FROM designation_master WHERE dsg_orgn='&&Orgn' and dsg_ctry='&&ctry'
    And dsg_loc ='&&loc' And dsg_oru = '&&oru' and dsg_grade in decode('&&radio_group',
    1, SELECT grd_code FROM grade_master WHERE grd_osm_code in (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&Orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'),
    2, SELECT grd_code FROM grade_master WHERE grd_osm_code > (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' and grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code),
    3, SELECT grd_code FROM grade_master WHERE grd_osm_code < (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'))
    thanks
    rincy

    please post your question in separate SQL and PL/SQL section this is FORMS section

  • Tuning query with inline views

    Hi!
    I have a performance problem with the following query. I try to combine v1 and v2 into one inline view but because of the recursive design of the tables workflow and workflow_node it didn't work.
    Does anybody has an idea for tuning this query?
    SELECT distinct v1.u_protocol_id
       FROM ( SELECT workflow_node.workflow_id,u_protocol.u_protocol_id
                   FROM workflow_node,workflow,U_protocol
                   WHERE workflow.workflow_id=workflow_node.workflow_id
                     AND u_protocol.u_protocol_id = workflow_node.parameter_2
                  AND workflow_node.workflow_node_type_id=17
                  AND workflow.workflow_node_type_id=42
             ) v1,
             ( SELECT workflow_node.workflow_id,test_template.test_template_id
               FROM workflow_node,test_template
               WHERE test_template.test_template_id = workflow_node.template
                 AND workflow_node.order_number = 1
                 AND workflow_node.workflow_node_type_id=42
             ) v2,
             ( SELECT aliquot.aliquot_id,test_template.test_template_id
               FROM aliquot,test,test_template
               WHERE aliquot.aliquot_id = test.aliquot_id
                 AND test.test_template_id = test_template.test_template_id
             ) v3
       WHERE v1.workflow_id = v2.workflow_id
         AND v2.test_template_id= v3.test_template_id

    I have found a script (utlxplan.sql) for creating the plan_table so here it is
    SQL> @c:\utlxplan.sql;
    Table created.
    SQL> EXPLAIN PLAN FOR SELECT distinct v1.u_protocol_id
      2     FROM ( SELECT workflow_node.workflow_id,u_protocol.u_protocol_id
      3         FROM lims_sys.workflow_node,lims_sys.workflow,lims_sys.U_protocol
      4         WHERE workflow.workflow_id=workflow_node.workflow_id
      5           AND u_protocol.u_protocol_id = workflow_node.parameter_2
      6        AND workflow_node.workflow_node_type_id=17
      7        AND workflow.workflow_node_type_id=42
      8       ) v1,
      9       ( SELECT workflow_node.workflow_id,test_template.test_template_id
    10         FROM lims_sys.aliquot,lims_sys.test,lims_sys.workflow_node,lims_sys.test_template
    11         WHERE aliquot.aliquot_id = test.aliquot_id
    12           AND test.test_template_id = test_template.test_template_id
    13     AND test_template.test_template_id = workflow_node.template
    14       ) v2
    15     WHERE v1.workflow_id = v2.workflow_id
    16  /
    Explained.
    SQL> SELECT * FROM TABLE(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id  | Operation                           |  Name                           |
    Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT                    |                                 |
    PLAN_TABLE_OUTPUT
          |       |       |
    |   1 |  SORT UNIQUE                        |                                 |
          |       |       |
    |   2 |   FILTER                            |                                 |
          |       |       |
    |   3 |    NESTED LOOPS                     |                                 |
          |       |       |
    PLAN_TABLE_OUTPUT
    |   4 |     NESTED LOOPS                    |                                 |
          |       |       |
    |   5 |      NESTED LOOPS                   |                                 |
          |       |       |
    |   6 |       NESTED LOOPS                  |                                 |
          |       |       |
    |   7 |        NESTED LOOPS                 |                                 |
          |       |       |
    PLAN_TABLE_OUTPUT
    |   8 |         NESTED LOOPS                |                                 |
          |       |       |
    |   9 |          TABLE ACCESS BY INDEX ROWID| WORKFLOW                        |
          |       |       |
    |* 10 |           INDEX RANGE SCAN          | FK_WORKFLOW_WORKFLOW_NODE_TYPE  |
          |       |       |
    |  11 |          TABLE ACCESS BY INDEX ROWID| WORKFLOW_NODE                   |
    PLAN_TABLE_OUTPUT
          |       |       |
    |  12 |           AND-EQUAL                 |                                 |
          |       |       |
    |* 13 |            INDEX RANGE SCAN         | FK_WORKFLOW_NODE_WORKFLOW       |
          |       |       |
    |* 14 |            INDEX RANGE SCAN         | FK_WORKFLOW_NODE_NODE_TYPE      |
          |       |       |
    PLAN_TABLE_OUTPUT
    |  15 |         TABLE ACCESS BY INDEX ROWID | U_PROTOCOL                      |
          |       |       |
    |* 16 |          INDEX UNIQUE SCAN          | PK_U_PROTOCOL                   |
          |       |       |
    |  17 |        TABLE ACCESS BY INDEX ROWID  | WORKFLOW_NODE                   |
          |       |       |
    |* 18 |         INDEX RANGE SCAN            | FK_WORKFLOW_NODE_WORKFLOW       |
          |       |       |
    PLAN_TABLE_OUTPUT
    |  19 |       TABLE ACCESS BY INDEX ROWID   | TEST_TEMPLATE                   |
          |       |       |
    |* 20 |        INDEX UNIQUE SCAN            | PK_TEST_TEMPLATE                |
          |       |       |
    |  21 |      TABLE ACCESS BY INDEX ROWID    | TEST                            |
          |       |       |
    |* 22 |       INDEX RANGE SCAN              | FK_TEST_TEST_TEMPLATE           |
    PLAN_TABLE_OUTPUT
          |       |       |
    |  23 |     TABLE ACCESS BY INDEX ROWID     | ALIQUOT                         |
          |       |       |
    |* 24 |      INDEX UNIQUE SCAN              | PK_ALIQUOT                      |
          |       |       |
    |  25 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    PLAN_TABLE_OUTPUT
    |  26 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    |  27 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    |  28 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    |  29 |    INDEX UNIQUE SCAN                | PK_OPERATOR_GROUP               |
          |       |       |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
      10 - access("SYS_ALIAS_5"."WORKFLOW_NODE_TYPE_ID"=42)
      13 - access("SYS_ALIAS_5"."WORKFLOW_ID"="WORKFLOW_NODE"."WORKFLOW_ID")
      14 - access("WORKFLOW_NODE"."WORKFLOW_NODE_TYPE_ID"=17)
    PLAN_TABLE_OUTPUT
      16 - access("SYS_ALIAS_4"."U_PROTOCOL_ID"=TO_NUMBER("WORKFLOW_NODE"."PARAMETER
    _2"))
      18 - access("WORKFLOW_NODE"."WORKFLOW_ID"="WORKFLOW_NODE"."WORKFLOW_ID")
      20 - access("SYS_ALIAS_1"."TEST_TEMPLATE_ID"="WORKFLOW_NODE"."TEMPLATE")
      22 - access("SYS_ALIAS_2"."TEST_TEMPLATE_ID"="SYS_ALIAS_1"."TEST_TEMPLATE_ID")
      24 - access("SYS_ALIAS_3"."ALIQUOT_ID"="SYS_ALIAS_2"."ALIQUOT_ID")
    Note: rule based optimization

  • Tuning query with sdo_join in it

    Hello all. I'm new to the forum, but I hope someone can help me tuning a spatial query. I have no DBA experience or education, but I'm writing SQL queries for a few years now, first in Oracle 9i (with Locator), now in Oracle 10g (10.2) and Oracle XE.
    I’ve posted this in the Spatial forum as I suspect it’s mostly a spatial issue.
    I have a table like:
    CREATE TABLE CYCLORAMA (
      DATASETID   VARCHAR2(9 BYTE),
      IMAGEID     VARCHAR2(9 BYTE),
      OPNAMEDATUM CHAR(20 BYTE),
      GEOMETRIE   MDSYS.SDO_GEOMETRY
    )with only a standard spatial index on GEOMETRIE, and containing about 180000 records. IMAGEID is unique, but not defined as such. Geometry is SDO_POINT_TYPE for all records, like: MDSYS.SDO_GEOMETRY(2001,90112,MDSYS.SDO_POINT_TYPE(86039.572,439541.158,'null'),'null','null'). USER_SDO_GEOM_METADATA is filled with values used for all my geometries: SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X',0,300000,,001), SDO_DIM_ELEMENT('Y',300000,600000,,001)) and SRID = 90112.
    What I need to do is to find (and ultimately delete) all records that have another record with a different value for DATASETID, a higher value for OPNAMEDATUM and fall within 3 meters distance. What I came up with so far is:
    select /*+ all_rows */ s.imageid
    , sdo_geom.sdo_distance(s.geometrie,t.geometrie,0.1) dist
    from cyclorama s, cyclorama t
    , table(sdo_join('CYCLORAMA','GEOMETRIE','CYCLORAMA','GEOMETRIE','distance=3')) x
    -- create a crosstable with records that may be within 3 meters distance
    where s.rowid = x.rowid1 and x.rowid2 = t.rowid and not x.rowid1 = x.rowid2
    -- filter 'duplicate matches' sdo_join generates for a self join, and select:
    and s.datasetid != t.datasetid                             -- if in different dataset
    and s.opnamedatum < t.opnamedatum                          -- from a later date
    and sdo_geom.sdo_distance(s.geometrie,t.geometrie,0.1) < 3 -- within 3 meters
    ;This is surprisingly fast (7 seconds for first 50 records), but still takes about 7 minutes (Oracle XE on a 768MB, 2.7GHz VM) for the whole query. This is acceptable, but:
    * Is this solution the best approach?
    * Can this be done faster or more efficient? Clever indexes, hints, smarter query, ...?
    * Is it worth optimizing the SDO_DIM_ARRAY for this table, e.g. narrowing the range of coordinate values)?
    * How to delete the found records most efficiently?
    * Can this be done using an anti-join, to select the records to keep?
    Thank you for reading this, and any answers you may have,
    J-----.
    Jeroen Muris

    Jack,
    Thank you for your response. It helped me to clean up the query. All the changes did not give a much better explain plan - at least not to my inexperienced eyes - but the total execution time for the query is now reduced to under two minutes. The query as it is now:
    select /*+ ordered all_rows */ x.rowid1
    from table(sdo_join('CYCLORAMA','GEOMETRIE','CYCLORAMA','GEOMETRIE','distance=3 mask=ANYINTERACT')) x
    , cyclorama s, cyclorama t
    where not x.rowid1 = x.rowid2
    and s.rowid = x.rowid1 and x.rowid2 = t.rowid
    and s.datasetid != t.datasetid
    and s.opnamedatum < t.opnamedatum;Because the docs state that mask=FILTER is the default, I added an explicit mask=ANYINTERACT to the sdo_join parameters when I removed the sdo_distance from the query. Still, the query returns 205035 records with the sdo_distance, and 205125 without. But this may be the result of the extra 0.001 from sdo_dim. I did not investigate as the 3 meter is not crucial.
    I believe I already had a mechanism in place to reduce the number of self-joins with "not x.rowid1 = x.rowid2" and "s.opnamedatum < t.opnamedatum". I can not guarantee that for all records s.opnamedatum < t.opnamedatum equals x.rowid1 < x.rowid2.
    Based on the [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14255/sdo_operat.htm#BGEDJIBF]docs, I finally added an 'ordered' hint and reshuffled the tables in the from clause.
    I'm happy with performance now, and creating a new table with the records to keep should not be a problem. Still I'm curious about the following:
    <li>Is it worth optimizing the SDO_DIM_ARRAY for the original table, e.g. narrowing the range of coordinate values?
    <li>How can sdo_join best be used for an anti-join, to select the records to keep?
    Thank you,
    J-----.

  • Sql Query with "IN" Operator

    Hi,
    Its amazing i could not able to understand that the results returned from my query
    Here is my query,
    SELECT * FROM TABLE1,TABLE2 WHRE TABLE1.ID = TABLE2.TABLE1_ID AND TABLE1.ID IN (5,4);
    This query returns the records of Id 4 first and then for the Id 5.
    I do no what happens, i need to use IN Operator in my Select query and i want to get the datas of the Id
    as per the Order I give
    How can i get the solution

    But in the query i can give any number of values like (7,2,1,4,8,..n)You can use global temporary table or collection to specify the order of
    numbers. In this case you have to use the join instead of IN:
    SQL> create global temporary table pos_tab (id number, position number);
    Table created.
    SQL> create table t_test as select rownum col from dict where rownum <=10;
    Table created.
    SQL> begin
      2   insert into pos_tab values(7,1);
      3   insert into pos_tab values(5,2);
      4   insert into pos_tab values(9,3);
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> select t_test.col from t_test, pos_tab where t_test.col = pos_tab.id
      2  order by pos_tab.position;
           COL
             7
             5
             9Simple collection example:
    SQL> create type pos_obj is object(id number, pos number);
      2  /
    Type created.
    SQL> create type pos_t is table of pos_obj;
      2  /
    Type created.
    SQL> select col from t_test, table(pos_t(pos_obj(7,1),pos_obj(5,2),pos_obj(9,3))) pos
      2  where pos.id = t_test.col order by pos.pos
      3  /
           COL
             7
             5
             9Rgds.
    Consider - IN-list operators are limited by 1000 explicit elements.
    Message was edited by:
    dnikiforov

  • SQL Query With Like Operator - Performance is very poor - Oracle Apps Table

    Hi,
    I'm querying one of the Oracle Applications Standard Table. The performance is very slow when like operator is used in the query condition. The query uses a indexed column in the where clause.
    The query is..
    select * from hz_parties
    where upper(party_name) like '%TOY%'
    In the above case, It is not using the index and doing full table scan. I have checked the explain plan and the cost is 4496.
    select * from hz_parties
    where upper(party_name) like 'TOY%'
    If I remove the '%' at the begining of the string, the performance is good and it is using the index. In this case, the cost is 5.
    Any ideas to improve the performance of the above query. I have to retrieve the records whose name contains the string. I have tried hints to force the use of index. But it is of no use.
    Thanks,
    Rama

    If new indexes are disallowed, not a lot of good ones, no.
    If you know what keyword(s) are going to be searched for, a materialized view might help, but I assume that you're searching based on user input. In that case, you'd have to essentially build your own Text index using materialized views, which will almost certainly be less efficient and require more maintenance than the built-in functionality.
    There may not be much you could do to affect the query plan in a reasonable way. Depending on the size of the table, how much RAM you're willing to throw at the problem, how your system is administered, and what Oracle Apps requires/ prohibits in terms of database configuration, you might be able to force Oracle to cache this table so that your full table scans are at least more efficient.
    Justin

  • Oracle query tuning : query with Order-by clause

    Hi
    I am having a query in my database :
    SELECT * FROM SAPR3.HRP1001 WHERE "MANDT" = 990
    ORDER BY
    "MANDT" , "OTYPE" , "OBJID" , "PLVAR" , "RSIGN" , "RELAT" , "ISTAT" , "PRIOX" , "BEGDA" , "ENDDA" ,"VARYF" , "SEQNR" ;
    Autotrace output is :
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=4649 Card=171895 Byt
    es=22862035)
    1 0 SORT (ORDER BY) (Cost=4649 Card=171895 Bytes=22862035)
    2 1 TABLE ACCESS (FULL) OF 'HRP1001' (Cost=1170 Card=171895
    Bytes=22862035)
    Statistics
    0 recursive calls
    5 db block gets
    12157 consistent gets
    11543 physical reads
    0 redo size
    38253080 bytes sent via SQL*Net to client
    376841 bytes received via SQL*Net from client
    34201 SQL*Net roundtrips to/from client
    0 sorts (memory)
    1 sorts (disk)
    512992 rows processed
    Since it is a issue with order by , it seems a PGA memory issue. there is 12GB PGA available but only 3GB gets allocated. pga_aggregate target is set in the DB. There is a index created for al the columns on order by, but it is not getting used.
    pleas suggest me as I am running into major problems, i can post the output of any query u require from my side. Any help wil be highly apprciated.
    Rishi

    > The query was alwasy spilling over to the One-Parse execution . It can be seen thru ST04N ->resource consumption-> sql work area trace.
    >
    > An undocumented oracle parameter smmmax_size was set which allowed for more usage of physical memory by single process and there was no spillover to the TEMP tablespaces.
    >
    > Also the File read time was analysed from Unix level ( From SAP thru ST04 ->filesystem wait s-> Avg rd (ms) and Ang writes (ms) which showed that reading from the File was not happening well. )
    Hi Rishi,
    the provided execution statistics prove the opposite:
    >Statistics
    >...
    >0 sorts (memory)
    > 1 sorts (disk)
    >512992 rows processed
    This indeed was a single-pass sort, which means it had to use the temp tablespace for one pass of the sorting/grouping.
    Remember that Oracle distinguishes three kinds of sorts: 1. "in memory", 2. "single-pass" and 3. "multi-pass".
    Only the first one won't need to spill out data to the disks. The others do this by definition.
    BTW: the file read times in ST04 are aquired through Oracle V$ views and not directly from the OS - that can make a big difference sometimes.
    regards,
    Lars

  • Tuning query with index

    hello,
    i am trying to avoid full table scan in a query by creating reverse index on the name column in the where clause. but the optimizer still runs full table scan. What can I do?
    Regards,
    Purvi

    Hi,
    Reverse key indexes reverse the bytes of each indexed column with the exception of rowid.
    I am not sure what you mean when you say the reverse index is supposed to index the names in reverse. When you use the reverse key index lexically adjacent keys are not stored next to each other.
    Maybe, reverse index is not right in your situation.

  • Trying to create a Javascript FetchXML query, cannot get Operator 'in' to work

    Hi all, I am writing a FetchXML query with the operator 'in' but I have messed up my syntax:
        fetchXml += "<condition attribute='statuscode' operator='in'/>";
        fetchXml += "<value>100000007</value>";
        fetchXml += "<value>100000004</value>";
    The above does not return a result. What is the correct syntax for this?

     fetchXml += "<condition attribute="statuscode" operator="in" >";
     fetchXml += "<value>100000007</value>"; 
     fetchXml += "</condition>";
     fetchXml += "<condition attribute="statuscode" operator="in" >";
     fetchXml += "<value>100000007</value>"; 
     fetchXml += "<value>100000004</value>";
     fetchXml += "</condition>";
    Regards, Saad

  • Criteria with out Operator in af:Query

    Hi,
    We are using af:query in our application and our application uses POJO based data controls. It does not implement BC4J. Is it possible to display a critieria in af:query WITH OUT a criteria operator? For example we want City as on the criteria and we would not want display any criteria operator. The assumption is it should always be searched with Equals. If it is possible can some one let me know how to achieve this?
    Thanks,
    Rama
    Edited by: user9954330 on Apr 24, 2012 10:59 PM

    Hi,
    Is it possible display a field in Search Panel as input LOV with custom popup ?
    Yes. You assign a LOV definition to the attribute that then you display in the af:query component. You can also have dependnet LOV implemented this way. However, you cannot have a custom (your own) list of value popup dialog used
    See page 8 and following in http://www.oracle.com/technetwork/developer-tools/adf/learnmore/jan2011-otn-harvest-300940.pdf
    Frank
    Edited by: Frank Nimphius on Jun 29, 2011 11:36 AM

  • Problem with the operator less than or equal to in a weby query

    Hi all.
    The universe is a OLAP Universe
    When i created a query in webi and put the month in the filter area with the operator less than or equal to like this.
    Month (less than or equal to) 2010.01 for example. The all result brings also the all values like 2010.02, 2010.03, etc
    What is the problem and how can fix that ?
    Thanks

    Looks like you are using a less than or equal to with a Sting data type.
    I think you should change to your filter to Year <= 2010 And Month <= 1. Hope you have a month and year object in you BeX.
    Anil

  • The query contains a formula with the operator SUMCT

    I m trying to get query ready for Webi, getting the error as 'The query contains a formula with the operator %RT. Therefore, the query cannot be released for OLE DB for OLAP'
    I have not used any kind of s %GT, %RT, %CT, SUMGT, SUMRT, SUMCT and LEAF, also i have suppressed results / over results from the query, over to it, i have removed the calculate results as 'summation' feature and set to 'not defined' for all of my key figures.
    Still getting the error...
    Please suggest.
    Niraj

    hi,
    Ensure that all Link IDs are visible in the lsdal.ini file  located in the \Windows\system directory of the PAS Server as those are then available to all users. The lsdal.ini file may not be correctly updated if: - You have created the BI Link IDs while using PAS in Client Server Mode - You have enabled multi user access for remote desktop. In this case an additional lsdal.ini file may appear in the user specific Windows directory of someone who may have remotely connected to the system to create the Link ID. That additional lsdal.ini file will only be valid for that specific user.
    Also try adding  "ODBOSECURITY=0" entry to the end of the c:\windows\lsserver.ini file on the server.
    hope it helps
    regards
    laksh

  • Query with || operator in IN clause

    Hi All,
    I am having two table emp_demo,dept_demo , below are the structure of the table :
    create table emp_demo(
    empno number primary key,
    ename varchar2(20),
    deptno number,
    dept_loc varchar2(20),
    dname varchar2(20)
    create table dept_demo(
    deptno number,
    dept_loc varchar2(20),
    dname varchar2(20)
    Query 1 :
    select * from emp_demo e where e.deptno||e.dept_loc||e.dname IN ( select d.deptno||d.dept_loc||d.dname from dept_demo d)
    Query 2 : 
    select * from emp_demo e where e.deptno  IN ( select d.deptno from dept_demo d)
    and e.dept_loc  IN ( select d.dept_loc from dept_demo d)
    and e.dname  IN ( select d.dname from dept_demo d)
    Could anyone please confirm that both the query will returns the same results in any condition.
    Thanks,
    Rajendra

    I agree with Karthick.
    Your query with || cannot be guaranteed to return the correct results, as it's possible that the concatenation of different strings could result in the same overall string
    As an illustrative example...
    if you have two strings... forename "FRED" and surname "SAMUEL BLOGGS" (very posh double barrelled surname)
    The concatenating these together can give us "FRED SAMUEL BLOGGS".
    Now what if the two strings we had were: forenames "FRED SAMUEL" and surname "BLOGGS"
    concatenating those together will also give us "FRED SAMUEL BLOGGS"
    So we had two lots of data, with different starting strings that resulted in the same overall string.
    In terms of your query, you should ideally join the data as Karthick showed, but just so you know, if you're wanting to do an IN clause on multiple columns, you do not concatenate the data together (it get's even more messy if the datatypes are different), but you actually treat all the columns as a set of data.  You do that using syntax like this...
    select *
    from emp_demo e
    where (e.deptno,e.dept_loc,e.dname) IN (select d.deptno,d.dept_loc,d.dname
                                            from   dept_demo d)
    Your second query is also completely different from the first query as it removes the relationship between the individual columns.  So, just because the dept_no is in the dept_demo table, and the dept_loc is also in the dept_demo table and the dname is also in the dept_demo table, doesn't mean that they all exist together on the same row of the dept_demo table.  I very much doubt that is what you wanted.
    SQL is set based.  That's a key thing to remember. 

  • Tuning SQL query with SDO and Contains?

    I'trying to optimize a query
    with a sdo_filter and an intermedia_contains
    on a 3.000.000 records table,
    the query look like this
    SELECT COUNT(*) FROM professionnel WHERE mdsys.sdo_filter(professionnel.coor_cart,mdsys.sdo_geometry(2003, null, null,mdsys.sdo_elem_info_array(1,1003,4),mdsys.sdo_ordinate_array(809990,2087279,778784,2087279,794387,2102882)),'querytype=window') = 'TRUE' AND professionnel.code_rubr ='12 3 30' AND CONTAINS(professionnel.Ctx,'PLOMBERIE within Nom and ( RUE within Adresse1 )',1)>0
    and it takes 15s on a bi 750 pentium III with
    1.5Go of memory running under 8.1.6 linux.
    What can i do to improve this query time?
    null

    Hi Vincent,
    We have patches for Oracle 8.1.6 Spatial
    on NT and Solaris.
    These patches include bug fixes and
    performance enhancements.
    We are in the process of making these patches
    avaialble in a permanent place, but until then, I will temporarily put the patches on:
    ftp://oracle-ftp.oracle.com/
    Log in as anonymous and use your email for
    password.
    The patches are in /tmp/outgoing in:
    NT816-000706.zip - NT patch
    libordsdo.tar - Solaris patch
    I recommend doing some analysis on
    individual pieces of the query.
    i.e. time the following:
    1)
    SELECT COUNT(*)
    FROM professionnel
    WHERE mdsys.sdo_filter(
    professionnel.coor_cart,
    mdsys.sdo_geometry(
    2003, null, null,
    mdsys.sdo_elem_info_array(1,1003,4),
    mdsys.sdo_ordinate_array(
    809990,2087279,
    778784,2087279,
    794387,2102882)),
    'querytype=window') = 'TRUE';
    2)
    SELECT COUNT(*)
    FROM professionnel
    WHERE CONTAINS(professionnel.Ctx,
    'PLOMBERIE within Nom and ( RUE within Adresse1)',1) >0;
    You might want to try reorganizing the entire
    query as follows (no promises).
    If you contact me directly, I can try to
    help to further tune the SQL.
    Hope this helps. Thanks.
    Dan
    select count(*)
    FROM
    (SELECT /*+ no_merge */ rowid
    FROM professionnel
    WHERE mdsys.sdo_filter(
    professionnel.coor_cart,
    mdsys.sdo_geometry(
    2003, null, null,
    mdsys.sdo_elem_info_array(1,1003,4),
    mdsys.sdo_ordinate_array(809990,2087279,
    778784,2087279,
    794387,2102882)),
    'querytype=window') = 'TRUE'
    ) a,
    (SELECT /*+ no_merge */ rowid
    FROM professionnel
    WHERE CONTAINS(professionnel.Ctx,
    'PLOMBERIE within Nom and
    ( RUE within Adresse1)',1) >0
    ) b
    where a.rowid = b.rowid
    and professionnel.code_rubr ='12 3 30';
    **NOTE** Try this with no index on code_rubr
    null

Maybe you are looking for

  • Neither my mouse or keyboard (both wired

    I have installed Windows 7 using Boot Camp. I can use either wired or bluetooth keyboards and a mouse. After I install the drivers neither keyboard or mouse works. It is as though the USB ports are disabled and bluetooth doesn't work. I have just uni

  • How do I create a start-up disk image without restarting from the Install DVD?

    (I know this is not MacBook Pro question per se, but I can't find a software discussion this applies to.) Situation: My MBP is running, but it's acting up and Onyx tells me that the start-up volume needs repair and directs me to use Disk Utility. But

  • Windows 2012 & 8.1 ADMX with Windows 7 System

    Hello, We are a Windows 2008R2 & Windows 7 Ent Shop with System Center 2012 R2 & PKI Servers. We need to deploy 30 Windows 8.1 Enterprise Lenovo Tablets to the field. Would all our Windows 7 GPO still work if we upgrade/update our Central Store with

  • error-page not working in J2EE SDK 5 Update 1

    I recently migrated from Tomcat 5 to J2EE SDK 5 Update 1, and since, have not been able to get my custom error page working. I have verified the path to the error page by testing the link directly in a browser, but still see the default gray and whit

  • Is it possible for Ipod touch to get hacked?

    I seriously feel like my Ipod touch was hacked. When I woke up this morning, it was acting weird. There were a whole bunch of apps open that I had not opened. When I tried to update my apps, it was saying that my Apple ID had been locked for saftey r