Use of index based on an attribute when doing an order by

Hi,
I create a table and its indexes like this:
create table poc_wip2 of xmltype
xmlschema "http://www.derwent.co.uk/wpi.xsd" element "WPI"
alter table poc_wip2
add constraint poc_wip2_pk primary key
(XMLDATA."BibPt"."PDOC_COUNTRY",
XMLDATA."BibPt".pdoc_serial, XMLDATA."BibPt".pdoc_kind)
create index pan_index on poc_wip2 t
(extractvalue(value(t),'/WPI/BibPt/@pan'))
Now when I run the query:
select extractvalue(value(t),'/WPI/BibPt/@pan')
from poc_wip2 t
order by extractvalue(value(t),'/WPI/BibPt/@pan')
I can see that a full table scan occurs. I cannot get the query to use the index built on the pan attribute.
I tried adding a INDEX_FFS hint, but this does not work when I name the pan_index, it only works with
INDEX_FFS(t), in which case the query then uses the primary key index.
Is it possible to get the query to use the pan_index index?
Thanks
Pete

Hi
Create a restricted key figure with the ZSE_BPNV1 and mention the values of the attribute and display the values
Here you can mention your charecteristic and attrribute value both with the key figure
Assign points if useful
Regards
N Ganesh

Similar Messages

  • Memory consumption issues (when doing large batches of photos)

    I have a user who reports my plugin consumes memory until Lr/System is no longer operable, when doing large batches of photos.
    I have this type of problem too from time to time, but not always, and in the most recent case, *not* for the same operation my client is complaining about.
    Begs the question: is there a way to control whether excessive memory is used, or force it to be released, when doing an operation upon large batches of photos.
    Note: the operation is already concluding catalog transactions every 1000 photos (exits with-write function, and re-enters). My client reports Lr/System slowdown at about 4000 photos. He is running Lr3, Windows OS - system details not yet known.
    Rob

    Hey Rob
    Have you already tried John R. Ellis idea of reducing the transaction size? I remember from another project we had to limit the transaction size on a SQLite based database due to memory problems.
    Maybe you are facing a different problem - not sure how efficient LUAs garbage collection is and your code causes some kind of memory leaks somewhere.
    Daniel

  • Error when posting Purchase Orders

    Hello,
    Client gets the followin error for a particular item when doing purchase order : -
    No matching records found 'withholding tax'  (OWHT)
    The error does not appear when purchase order is done from the server directly, but appears on SAP clients.
    What could be causing this error ?

    hello Martin,
    is this error occur in only one particular BP or it occurs in all BP?
    if this error only occurs in one BP
    1. goto the BP master data - Accounting Tab - Tax sub-tab
    2. Check the tick box "Subject to withholding tax"
    3. WT Code allowed - clikc the button in the right side "This will open WT Code allowed window" set default one of the existing WT code available.
    4. Update BP Master Data.
    hope this helps...
    Fidel

  • Problem using two function based indexes at once!

    Hello Oracle!
    I've got problems using two function based indexes on geometries at once.
    The problem occures, when I use a spatial join between two geometries both using function based indexes.
    The test case:
    CREATE TABLE quad (centroid NUMBER);
    CREATE TABLE points (no NUMBER, point MDSYS.SDO_GEOMETRY);
    CREATE OR REPLACE FUNCTION getQuad (centroid NUMBER) RETURN MDSYS.SDO_GEOMETRY DETERMINISTIC IS
    BEGIN
    RETURN MDSYS.SDO_GEOMETRY(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(centroid-5,centroid-5,centroid+5,centroid-5,centroid+5,centroid+5,centroid-5,centroid+5,centroid-5,centroid-5));
    END;
    INSERT INTO USER_SDO_GEOM_METADATA VALUES('quad','tiedge.getQuad(centroid)',MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X', -100, 100, .0000001), MDSYS.SDO_DIM_ELEMENT('Y', -100, 100, .0000001)),NULL);
    CREATE INDEX quad_idx on quad(getQuad(centroid)) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    INSERT INTO quad VALUES (0);
    INSERT INTO quad VALUES (5);
    INSERT INTO quad VALUES (10);
    INSERT INTO points VALUES (1, MDSYS.SDO_GEOMETRY(1001,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1,1),MDSYS.SDO_ORDINATE_ARRAY(4,4)));
    ALTER SESSION SET QUERY_REWRITE_INTEGRITY=TRUSTED;
    ALTER SESSION SET QUERY_REWRITE_ENA[i]Long postings are being truncated to ~1 kB at this time.

    hi there,
    For a better audience for this question, I'd look at the database forum.
    guys on that will be a lot more familiar with FBIs
    thanks
    Barry

  • How to prevent Oracle from using an index when joining two tables ...

    How to prevent Oracle from using an index when joining two tables to get an inline view which is used in an update statement?
    O.K. I think I have to explain what I mean:
    When joining two tables which have many entries sometimes it es better not to use an index on the column used as join criteria.
    I have two tables: table A and table B.
    Table A has 4.000.000 entries and table B has 700.000 entries.
    I have a join of both tables with a numeric column as join criteria.
    There is an index on this column in table A.
    So I instead of
      where (A.col = B.col)I want to use
      where (A.col+0 = B.col)in order to prevent Oracle from using the index.
    When I use the join in a select statement it works.
    But when I use the join as inline view in an update statement I get the error ORA-01779.
    When I remove the "+0" the update statement works. (The column col is unique in table B).
    Any ideas why this happens?
    Thank you very much in advance for any help.
    Regards Hartmut

    I think you should post an properly formatted explain plan output using DBMS_XPLAN.DISPLAY including the "Predicate Information" section below the plan to provide more details regarding your query resp. update statement. Please use the \[code\] and \[code\] tags to enhance readability of the output provided:
    In SQL*Plus:
    SET LINESIZE 130
    EXPLAIN PLAN FOR <your statement>;
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);Usually if you're using the CBO (cost based optimizer) and have reasonable statistics gathered on the database objects used the optimizer should be able to determine if it is better to use the existing index or not.
    Things look different if you don't have statistics, you have outdated/wrong statistics or deliberately still use the RBO (rule based optimizer). In this case you would have to use other means to prevent the index usage, the most obvious would be the already mentioned NO_INDEX or FULL hint.
    But I strongly recommend to check in first place why the optimizer apparently seems to choose an inappropriate index access path.
    Regards,
    Randolf
    Oracle related stuff:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Insert using Spatial Index fails when called from PHP

    I have a stored procedure that inserts into a table with a spatial index on one of its fields.
    When I run the procedure from SQL Server Management Studio it runs just fine.
    When I run it from PHP, it returns the error: "INSERT failed because the following SET options have incorrect settings: 'CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes
    on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations"
    From within Management Studio, I have tried many different combinations of settings, until I wound up with the list I have in the procedure below.
    Within Managment Studio the error changes based on the options I have set, but PHP always replies with: 'CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING'
    I have configured PHP to use the same SQL user as management studio, and I have tried both mssql_query and mssql_execute with bound parameters.
    The spatial index is on the field post.location If I remove the spatial index it works, but I need the spatial index.
    CREATE PROCEDURE insert_post ( @subject AS VARCHAR(250), @body AS VARCHAR(2000), @latitude AS FLOAT, @longitude AS FLOAT ) AS BEGIN
    SET NOCOUNT ON
    SET ANSI_WARNINGS ON
    SET ANSI_PADDING ON
    SET CONCAT_NULL_YIELDS_NULL ON
    SET NUMERIC_ROUNDABORT OFF
    DECLARE @location AS geography = geography::Point(@latitude, @longitude, 4326)
    INSERT INTO post
        subject,
        body,
        location
    ) VALUES (
        @subject,
        @body,
        @location
    END

    Hi Charles
    Your issue looks like it have two basic sources: (1) The connection string properties, (2) The table structure and the data which you try to insert.
    (1) The connection string properties can be specified in various ways.
    You can set most of them during the connection, depending on the provider which you are using. We did not get from you any information about the PHP code, so we have no information regarding this part.
    The connection properties can be changed after the connection was made, which is basically what you have try to do. But we don't know what properties
    are differents (since you .. the PHP code..) but you can check those properties dynamically, insert them to a table and then compare. To check all the properties you can use this post:
    http://ariely.info/Blog/tabid/83/EntryId/153/SQL-Server-Get-Connection-Properties.aspx
    (2) We need to understand your
    table structure and compare it to yours query. Please post your DDL+DML (queries to create the table and to insert some sample data), and the full SP code
    as it is now.
    [Personal Site]  [Blog]  [Facebook]

  • Index Usage in 9i changed  when used rownum

    Hi List,My Application is in RBO
    Here is one more brain twister ?
    Assume following I Have table SHRI with a single column
    COL I have created Index on COL column say IND_COL.
    Now when I run Following query on 8i with AUTOTRACE ON
    I can see that 8i Uses the Index IND_COL Clearly .
    select * from shri where (h_name='ABC' or h_name='BOM')
    or (h_name ='BOM' or h_name='MOM')
    and rownum=1
    select * from shri where (COL='ABC' or COL='BOM')
    or (COL='ABC' or COL='BOM')
    and rownum=1
    (Note:Above example is just for ur understanding plz.dont see the usage)
    Now my problem is when I see the explain plan for above query in 8i I can see that Query uses IND_COL .
    But when I run the same in 9i It does not uses IND_COL Index (Strange!!!) .
    However when I remove "and rownum=1" clause then It again uses the index in 9i.
    Assume that such queries are existing many places .
    I am badly stuck because of this problem can anybody suggest the best way (Other than changing RBO to CBO) ?
    Regards
    Sripad.

    Run below query, you will get all the details of tablespaces.
    col "Tablespace" for a22
    col "Used MB" for 99,999,999
    col "Free MB" for 99,999,999
    col "Total MB" for 99,999,999
    select df.tablespace_name "Tablespace",
    totalusedspace "Used MB",
    (df.totalspace - tu.totalusedspace) "Free MB",
    df.totalspace "Total MB",
    round(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace))
    "Pct. Free"
    from
    (select tablespace_name,
    round(sum(bytes) / 1048576) TotalSpace
    from dba_data_files
    group by tablespace_name) df,
    (select round(sum(bytes)/(1024*1024)) totalusedspace, tablespace_name
    from dba_segments
    group by tablespace_name) tu
    where df.tablespace_name = tu.tablespace_name ;

  • How to get cm:search to use the max attribute when creating the SQL query?

    When we use the max attribute in the cm:search tag, it does not seem to honor the max attribute when creating the SQL query. However, the result returned from the tag is limited to the number specified by the max attribute. Then the tag seems to work as intended, but the performance will be sub optimal when the SQL query returns unnecessary rows to the application.
    We use the cm:search tag to list the latest news (ordered by date), and with the current implementation we have to expect a decrease in performance over time as more news is published. But we can’t live with that. We need to do the constraint in the SQL query, not in the application.
    The sortBy attribute of cm:search is translated to “order by” in the SQL query, as expected.
    Is it possible to get cm:search to generate the SQL query with an addition of “where rownum <= maxRows”?

    Hi Erik,
    The behavior of a repository in regards to the search tag's max results parameter is dependent on the underlying repository's implementation. That said, the OOTB repository in WLP does augment the generated SQL to limit the number of rows returned from the database. This is done in the parsing logic. This behavior may differ with other repository implementations.
    -Ryan

  • ISE Not Identifying AD Group Attributes when using Multiple ISE Servers

    So we have multiple ISE Servers with differing personas. I was having an issue with our new ISE setup not identifying AD Group Attributes when using them in Authorization rules.
    We have 2- 3395 appliances running Admin and Monitoring/Troubleshooting Personas and 2- 3395 appliances running as Policy server personas. We are running  v1.1.1.268 with the latest two patches.
    I was unable to pull Active Directory Group Attributes in any of my Authorization rules. After Resyncing all the boxes with the Primary Administration box I was able to do this. There is no bug listings for this occurance nor do we have Smartnet to call support for other reasons. I thought this might be useful to someone who is having the same issue and is unable to figure it out with TAC
    -CC

    Absolutely. All units said in-sync after setting their personas.
    Here is our layout:
    ISE-ADM-01  Admin-Primary, Monitoring-Secondary
    ISE-ADM-02  Admin-Secondary, Monitoring-Primary
    ISE-PDP-01  Policy Only
    ISE-PDP-02  Policy Only
    I synced one at a time starting with ADM-02. After completing the other two boxes. Active Directory Attribs were pulled down when using them in the Ext Group within my Authz rules.
    -CC

  • How can i set  "Createdby" attribute  When using Custom JheadStart Security

    Hello
    We do not use JASS for Authentication , please help us how can i set createtby attributes with jhs.username in application for any entity object?
    thanks

    See a similar question at History Attributes when using Custom Authentication Type

  • How to use SQL import to set the attribute value based on another?

    Hello all,
    I want to set an attribute of a dimension based on another attribute (if matches). Let's say I have a dimension PRODUCT. And I have defined two user defined attributes MANAGER and ISVISIBLE.
    Now within a PERMIT_READ program I want to set the ISIVISIBLE to true where the MANAGER Value is selected from a table.
    Something like
    <define a cursor c1 to select all the Manager values>
    sql import c1 into -
    :MATCHSKIPERR PRODUCT_MANAGER then <PRODUCT_ISVISIBLE (PRODUCT MANAGER) = true>
    <etc>
    Obviously the above is not correct. But I am stuck as to how this can be done? Can some one on this forum please help me with correct syntax/ approach please?
    Thanks a lot.
    Pxsheth
    This statement assigns true to the isvisible attribute for every gc_dim_bu dimension (selected as part of cursor c1).
    SO FAR SO GOOD.. NOW -
    If I want to change the above so that the attribute value gets assigned based on another attribute for the dimension (say a flag). i.e.
    Set the isvisible to true where attribute flag has a certain value. How do I code this in OLAP DML?

    There are a number of ways to do this. If you want to use an attribute that has been defined within AWM as an attribute of Product then simply using the mapping tool to populate the attribute as part of the normal dimension load procedure.
    Alternatively you could create an attribute at the DML level, and assuming you are not using surrogate keys, you can then define a cursor to read the relational table to populate your attribute. Something like this:
    sql declare MKT_BASKET cursor for -
    select PRODUCT_ID, PROD_MGR , PROD_VISIBLE -
    from PRODUCT_DIM
    if SQLCODE ne 0
    then goto ERROR
    sql open MY_CURSOR
    sql fetch MY-CURSOR loop into :append PRODUCT, :PRODUCT_MANAGER, :PRODUCT_ISVISIBLE
    sql close MY_CURSOR
    sql cleanup
    update
    commit
    If you want to create a complex PERMIT function using OLAP DML then personally I would create a formula and assign a program of type BOOLEAN and have the program return a YES or NO depending on the outcome of your test. Then your PERMIT_READ still references a dimension object. For example:
    DEFINE PROD.ISVISIBLE BOOLEAN FORMULA <PRODUCT>
    EQ PRG.ISVISIBLE(PRODUCT)
    DEFINE PRG.ISVISBLE PROGRAM BOOLEAN
    The program will then return Yes or No depending on the processing you need to do.
    Hope this helps
    Keith Laker
    Data Warehouse Solution Architect
    Oracle EMEA Consulting
    BI Blog: http://oraclebi.blogspot.com/
    DM Blog: http://oracledmt.blogspot.com/
    BI on Oracle: http://www.oracle.com/bi/
    BI on OTN: http://www.oracle.com/technology/products/bi/
    BI Samples: http://www.oracle.com/technology/products/bi/samples/

  • Rule-Based Optimizer doesn4t use the index

    Does anybody know why the rule-based optimizer doesn4t use the index of all columns in the where clause?
    I have a select that use the hint RULE to force the optimizer to work in rule mode and also one index to all columns used in the where clause. Analyzing the execution plan (EXPLAIN PLAN) I observed the optimizer accesses all tables, but one, using the index. There4s one table (the first of the execution plan) that is accessed using a Full Table Scan (FTS).
    I've rebuilt the index for this table, but the execution plan doesn4t change.
    Any suggestions?
    Thanks in advance.
    Eliane.

    Hi. Oracle may not use an index if it finds that a full table scan is quicker/more efficient. Try the hint /*+ INDEX (table index) */ and compare the query performance with that of the one without this hint. (As you know, if you force Rule-based approach, the COST column in EXPLAIN PLAN output will not be populated. You may have to use trace/tkprof.)

  • When I send my ical link to my better half , who sadly, still uses a windows based system- He cannot open the link back to my calendar- any help?

    When I send my ical link to my better half , who sadly, still uses a windows based system- He cannot open the link back to my calendar- any help?

    I've been using iCloud since it's inception as "mac.com" or whatever it was called. I've been able to Sync Outlook Exchange Calenars to my iMac, iPhone and iPad. However, I cannot get iCal (when viewed in iCloud) to display Exchange or Google Calender items.
    It's odd, all other Mac versions of iCal are happy e.g. iMac, MacBook Air, iPad Air, iPhone etc. But nothing when I login to icloud.com and look at the iCal there.

  • How to make use of indexes when using group by caluse?

    Hi All
    I am using a query with a group by caluse without any WHERE caluse.There are indexes on columns in the select clause,but the explain plan shows a full table scan.Can this be avoided and make use of indexes?
    Execution Plan
       0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=347 Card=27007 Byt
              es=1053273)
       1    0   HASH (GROUP BY) (Cost=347 Card=27007 Bytes=1053273)
       2    1     TABLE ACCESS (FULL) OF 'TABLEXYZ' (TABLE) (Cost=73 Ca
              rd=27007 Bytes=1053273)
    Statistics
              1  recursive calls
              0  db block gets
            317  consistent gets
              0  physical reads
            116  redo size
         373725  bytes sent via SQL*Net to client
          12351  bytes received via SQL*Net from client
           1086  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          16268  rows processedThanks in Advance

    user10450559 wrote:
    Hi All
    I am using a query with a group by caluse without any WHERE caluse.There are indexes on columns in the select clause,but the explain plan shows a full table scan.Can this be avoided and make use of indexes?In principle there are cases where Oracle can use an index range or full scan to do a group by without sorting if the "group by" columns are the leading columns in the index. But if you want an intelligent answer in your case, you will have to post the query and the definition of the index you think is the one that should be used.
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    "Science is more than a body of knowledge; it is a way of thinking" Carl Sagan

  • When does MaxDB use Index strategy?

    Hello,
    I want to improve the performance of my MaxDB. So I tried to create indexes and now I want to check if these indexes are used or not!
    1st: Is there a possibility to force MaxDB to use the index, if the sql statement consists e.g. LIKE '%N600%'?
    2nd: Exist a list or something else where I can see which sql statements in MaxDB dont support index strategy?
    Thx for help and kind regards,
    Frank

    Hello Frank,
    A1: You could force MaxDB to use an index - but this wouldn't help much. The index could not be used efficiently with a like condition which starts with %.
    Q2: Please check out the tuning section in the Wiki:
    https://wiki.sdn.sap.com/wiki/x/jRI
    Especially this section might be of interest for you:
    https://wiki.sdn.sap.com/wiki/x/GXE
    In General: if you want to check the execution plan for a specific SQL statement, use the EXPLAIN statement (just add EXPLAIN before the SELECT and execute it in SQLStudio).
    HTH,
    Melanie

Maybe you are looking for