Function Index with Upper

I am trying to use a function index and am having trouble. I built the index successfully using the syntax:
CREATE INDEX COUNTRY_INDX1 ON COUNTRY(Upper(country_name));
Then, I submitted a query such as:
SELECT * FROM COUNTRY WHERE country_name = 'USA';
I computed EXPLAIN PLAN and it still does a FULL access of the table. If I do something like Upper(country_name) in the where clause, it still doesn't find the correct index.
Do I need to form my query differently to use the Function Index I created?
Thanks so much in advance!!!

SQL> desc emp
Name                                      Null?    Type
EMPNO                                              NUMBER(4)
ENAME                                              VARCHAR2(10)
JOB                                                VARCHAR2(9)
MGR                                                NUMBER(4)
HIREDATE                                           DATE
SAL                                                NUMBER(7,2)
COMM                                               NUMBER(7,2)
DEPTNO                                             NUMBER(2)
SQL> create index idx_emp_ename on emp(upper(ename)) ;
Index created.
SQL> analyze table emp compute statistics for table for all indexed columns ;
Table analyzed.
SQL> exec dbms_stats.set_table_stats(user, 'EMP', numblks => 100000) ;
PL/SQL procedure successfully completed.
SQL> set autotrace traceonly
SQL> select * from emp where upper(ename) = 'A%' ;
Execution Plan
   0      SELECT STATEMENT Optimizer=CHOOSE (Cost=60 Card=1 Bytes=40)
   1    0   TABLE ACCESS (BY INDEX ROWID) OF 'EMP' (Cost=60 Card=1 Byt
          es=40)
   2    1     INDEX (RANGE SCAN) OF 'IDX_EMP_ENAME' (NON-UNIQUE) (Cost
          =2 Card=1)
SQL>

Similar Messages

  • Version 4.0.0.12 (EA) - functional indexes of a table are listed twice

    Hello,
    it seems that functional indexes are listed twice if there are two functions within the index columns.....
    Example (Content from the indexes tab of the table view):
    owner    ....._PK    UNIQUE    VALID    NORMAL    N    NO
    NO    ....._UUID 
    owner    ....._UI1    UNIQUE    VALID    FUNCTION-BASED NORMAL    N    NO    ENABLED    NO    SYS_NC00016$, SYS_NC00017$, ....._ID, ....._PLAN_ID    SYS_EXTRACT_UTC("....._START")
    owner    ....._UI1    UNIQUE    VALID    FUNCTION-BASED NORMAL    N    NO    ENABLED    NO    SYS_NC00016$, SYS_NC00017$, ....._ID, ....._PLAN_ID    SYS_EXTRACT_UTC("....._END")
    Both functions are in the same index "....._UI1".
    The detail panel shows the same details.

    MPf_dba&dataGmbH wrote:
    Hello,
    it seems that functional indexes are listed twice if there are two functions within the index columns.....
    Example (Content from the indexes tab of the table view):
    owner    ....._PK    UNIQUE    VALID    NORMAL    N    NO 
    NO    ....._UUID  
    owner    ....._UI1    UNIQUE    VALID    FUNCTION-BASED NORMAL    N    NO    ENABLED    NO    SYS_NC00016$, SYS_NC00017$, ....._ID, ....._PLAN_ID    SYS_EXTRACT_UTC("....._START")
    owner    ....._UI1    UNIQUE    VALID    FUNCTION-BASED NORMAL    N    NO    ENABLED    NO    SYS_NC00016$, SYS_NC00017$, ....._ID, ....._PLAN_ID    SYS_EXTRACT_UTC("....._END")
    Both functions are in the same index "....._UI1".
    The detail panel shows the same details.
    What version of SQL*Developer?
    I am using 3.2.20.09 and created 2 function-based indexes on a practice employee table, upper() on both first and last names.  When displaying indexes through the table display using the Indexes tab and through the object navigator using indexes I only see each index once.
    On a second pass I created a third composite index with upper on both first and last names and got the results similar to those you describe in both places.  The column names (expression name in the table index pane) were different.

  • Function-based index with OR in the wher-clause

    We have some problems with functin-based indexes and
    the or-condition in a where-clause.
    --We use Oracle 8i (8.1.7)
    create table TPERSON(ID number(10),NAME varchar2(20),...);
    create index I_NORMAL_TPERSON_NAME on TPERSON(NAME);
    create index I_FUNCTION_TPERSON_NAME on TPERSON(UPPER(NAME));
    The following two statements run very fast on a large table
    and the execution-plan asure the usage of the indexes
    (-while the session is appropriate configured and the table is analyzed):
    1)     select count(ID) FROM TPERSON where upper(NAME) like 'MIL%';
    2)     select count(ID) from TPERSON where NAME like 'Mil%' or (3=5);
    In particular we see that a normal index is used while the where-clause contains
    an OR-CONDITION.
    But if we try the similarly select-statement
    3)     select count(ID) FROM TPERSON where upper(NAME) like 'MIL%' or (3=5);
    the CBO will not use the function-index I_FUNCTION_TPERSON_NAME and we have a full table scan in the execution-plan.
    (This behavior we only expect with views but not with indexes.)
    We ask for an advice like a hint, which enable the CBO-usage
    of function-based indexes in connection with OR.
    This problem seems to be artificial because it contains this dummy logic:
         or (3=5).
    This steams from an prepared statement, where this kind of boolean
    flag reduce the amount of different select-statements needed for
    covering the hole business-logic, while using bind-variables for the
    concrete query-parameters.
    A more realistic (still boild down) version of our select-statement is:
    select * FROM TPERSON
    where (upper(NAME) like 'MIL%' or (NAME is null))
    and (upper(FIRSTNAME) like 'MICH% or (FIRSTNAME is null))
    and ...;
    thank you for time..
    email: [email protected]

    In the realistic statement you write :
    select * FROM TPERSON
    where (upper(NAME) like 'MIL%' or (NAME is null))
    and (upper(FIRSTNAME) like 'MICH% or (FIRSTNAME is null))
    and ...;
    as far as i know, NULL values are not indexed, "or (NAME is NULL)" have to generate a full table scan.
    HTH
    We have some problems with functin-based indexes and
    the or-condition in a where-clause.
    --We use Oracle 8i (8.1.7)
    create table TPERSON(ID number(10),NAME varchar2(20),...);
    create index I_NORMAL_TPERSON_NAME on TPERSON(NAME);
    create index I_FUNCTION_TPERSON_NAME on TPERSON(UPPER(NAME));
    The following two statements run very fast on a large table
    and the execution-plan asure the usage of the indexes
    (-while the session is appropriate configured and the table is analyzed):
    1)     select count(ID) FROM TPERSON where upper(NAME) like 'MIL%';
    2)     select count(ID) from TPERSON where NAME like 'Mil%' or (3=5);
    In particular we see that a normal index is used while the where-clause contains
    an OR-CONDITION.
    But if we try the similarly select-statement
    3)     select count(ID) FROM TPERSON where upper(NAME) like 'MIL%' or (3=5);
    the CBO will not use the function-index I_FUNCTION_TPERSON_NAME and we have a full table scan in the execution-plan.
    (This behavior we only expect with views but not with indexes.)
    We ask for an advice like a hint, which enable the CBO-usage
    of function-based indexes in connection with OR.
    This problem seems to be artificial because it contains this dummy logic:
         or (3=5).
    This steams from an prepared statement, where this kind of boolean
    flag reduce the amount of different select-statements needed for
    covering the hole business-logic, while using bind-variables for the
    concrete query-parameters.
    A more realistic (still boild down) version of our select-statement is:
    select * FROM TPERSON
    where (upper(NAME) like 'MIL%' or (NAME is null))
    and (upper(FIRSTNAME) like 'MICH% or (FIRSTNAME is null))
    and ...;
    thank you for time..
    email: [email protected]

  • Issue with using N'...' values in a where clause against a function index

    We have a table that is defined with non Unicode columns with a UPPER(..) function index on the index column (to allow searching in any alphabetic case)
    e.g.
    create table my_table
    index_column varchar2(20),
    desc_column varchar2(40)
    create index my_table_idx as on my_table(UPPER(index_column));
    there is approx. > 10 million rows in this table
    The issue we have is that when we do the following select
    select index_column, desc_column from my_table
    where upper(index_column) = 'SOME VALUE'; this statement runs in approx 0.03 seconds which is great
    But we also have some statements that run as
    select index_column, desc_column from my_table
    where upper(index_column) = N'SOME VALUE'; notice the N'...' string (unicode) value used. This ends up doing a full table scan (> 5 seconds)
    So... the question is how can i make this select statement passing in a Unicode string value hit this function based UPPER index? Is there anyway?
    I have tried these extra indexes - to no avail
    create index my_table_idx as on my_table(UPPER(CAST(index_column as nvarchar2(20)));
    and
    create index my_table_idx as on my_table(UPPER(COMPOSE(index_column)));
    I assumed Oracle should have done and implicit conversion back to a non unicode string value and then passed that value into the UPPER(...) function index, but it appears as though Oracle isn't recognizing that the column is a different type (varchar2 vs nvarchar2)
    Any help greatly appreciated?

    Horrible amount of irrelevant tags, and the only thing relevant , the four digit version, is of course not mentioned.
    Also the characterset of the database is relevant.
    As far as I know in 11g and higher one no longer needs the N'<string construct>'
    As to implicit conversion
    assume <number_column> = '9'
    Oracle always converts this into
    to_char(<number_column>='9'
    Same applies to your case.
    Try leaving out the N, check whether it works and whether your function based index is used.
    Sybrand Bakker
    Senior Oracle DBA

  • Forcing Index use with UPPER or LOWER in the WHERE clause.

    Does anyone know how to force Oracle to use an index/Key when using UPPER or LOWER in the WHERE clause?

    You have to create a function index. Check your documentation on it.

  • Crash in evaopn2 with functional indexes

    Hi,
    I have a problem with 3rd party application running on oracle 10.2.0.3. When a particular statement is executed, it triggers error in evaopn2.
    As far as I know, there was a bug using functional indexes, but it was supposed to be fixed in 10.2.0.3, right?
    Oracle is running on ubuntu server 7.10. This is the only problem we have so far.
    What should I do?
    Regards
    Jernej
    Trace dump:
    Exception signal: 11 (SIGSEGV), code: 1 (Address not mapped to object), addr: 0x0, PC: [0x9616d1a, evaopn2()+104]
    Registers:
    %eax: 0x0000013c %ebx: 0x00000000 %ecx: 0xb6db8f6c
    %edx: 0x3afe7144 %edi: 0x00000000 %esi: 0x80000002
    %esp: 0xbffd23f0 %ebp: 0xbffd25b0 %eip: 0x09616d1a
    %efl: 0x00200246
    evaopn2()+86 (0x9616d08) test $0x20800400,%esi
    evaopn2()+92 (0x9616d0e) jnz 0x9616f21
    evaopn2()+98 (0x9616d14) mov %ebx,0xfffffffc(%ebp)
    evaopn2()+101 (0x9616d17) mov 0x28(%edx),%ebx
    evaopn2()+104 (0x9616d1a) mov (%ebx),%esievaopn2()+106 (0x9616d1c) movzw 0x4(%ebx),%edi
    evaopn2()+110 (0x9616d20) mov (%esi,%ecx),%ebx
    evaopn2()+113 (0x9616d23) mov %edi,0xffffffe8(%ebp)
    evaopn2()+116 (0x9616d26) mov %ebx,0xfffffff0(%ebp)
    *** 2008-05-31 01:52:24.592

    What should I do?Contact 3rd party product vendor. An OS exception is thrown in the application, that may be a 3rd party problem, may be an Oracle problem, may be a combination of both. Only the code developers can analyze this.
    Werner

  • How to integrate Oracle Tutor Desk manual Index with Oracle ApplicationsR12

    Hi,
    I have created a desk manual Index and related HTML files in oracle Tutor 14. Can anyone help me in integrating the desk manual index with the Oracle Applications Help.
    My questions are:
    -> In what top shd i upload my files using help Upload ?
    -> How do i integrate the desk manual index HTML file with my applications help?
    Has anyone done this before . If so , Can u please guide me through the process.
    Thanks.
    Edited by: Vyas on Apr 8, 2012 12:52 AM

    Here are some instructions - please let me know if this is what you are looking for.
    Kind Regards,
    Emily
    -> In what top shd i upload my files using help Upload ?
    Create Upload and Download Directories on Middle Tier.
         The download path must be a location on the machine that hosts the Application Server - ie, the "middle tier". Directories for the upload (for example, /u01/tutor/upload) and download (for example, /u01/tutor/download) functions must be created on the middle tier.
         ***These directories, as well as any future subdirectories, must have full read/write/execute permissions. The Help Utility will automatically create subdirectories, so the permissions must be set correctly before the Help Utility is used.
         Verify that the HELP_UTIL_DOWNLOAD_DIR directory points to a directory that can be accessed from both the JServ tier and the Concurrent Manager tier.
    From the EBS
    EBS R12 System Administrator > Profile > System > Find System Profile Values
    - Verify Site is checked
    - Verify Profiles with No Values is checked
    - In the profile field, enter %help%
    - Click Find button
    Update system profile values with the correct paths.For example:
         Help Utility Download Path > /u01/tutor/download OR /dbfiles/applcsf/outbound
         Help Utility Upload Path > /u01/tutor/upload OR /dbfiles/applcsf/inbound
         Help System Root > FND:LIBRARY
         TCF:Host > http://<hostname.domainname>
         TCF:Port > <port number>
    -> How do i integrate the desk manual index HTML file with my applications help?
    Use Help Builder to add the DESK_MANUAL_INDEX to the Help Tree
    To learn all the features about customizing Help Navigation Trees, refer to the Oracle Applications System Administration User Guide.
    EBS R12 System Administration > Help Administration > Help Builder
    When Help Builder first opens it may appear as a tiny screen in the upper left corner, if this happens, maximize the screen. You may also have to resize the screen as you may see the entire screen at first.
    - Enter FND in the Node Application field.
    - Press the Find button on the Find Trees Window.
    This should bring the Trees tab region forward with a list of available trees.
    - Scroll down and find FND | US | Applications Help Library in the Trees tab
    - Select and double click on it.
    This will open the Applications Help Library tree in the left frame
    - Expand the Application Help Library by clicking on the + next to it.
    - Click the New Node icon on the toolbar.
    - Enter the following information in Properties window.
    The next items assume the default Desk Manual Index terminology is used.
    If your organization uses or plans to use different terms, adjust the entries in the various properties field accordingly.
         Prompt: Desk Manual Index
         Description: Desk Manual Index
         Data: @DESK_MANUAL_INDEX
    Or enter the exact Desk Manual Index file name if it is different than the example.
    - Click the View button to verify the link works.
    You may have to experiment with using the @ sign. It may not be required.
         Click the Apply button.
    The Desk Manual Index will now appear as a Node under the Application Help Library. If the name is NOT fully displayed, click on the - (minus) sign to expand it.
    Link does not work
    - Change the information in the Data field.
    - Delete the @ and add .htm extension
    Example: DESK_MANUAL_INDEX.htm
    - Click the View button to verify the link works.
    - Click on the Save icon.

  • BigString to Big String - how do I detect index of upper case?

    bigString to Big String - how do I detect index of upper
    case?
    Is there a way to detect, insert space and replace the upper
    case letters in a string?

    Something like this?
    <CFOUTPUT>#REReplace("bigString", "[A-Z]"," "&
    Mid("bigString", REfind("[A-Z]", "bigString"),
    1))#</CFOUTPUT>
    This will at least give you a break at the first upper case
    letter. You can then replace the first character in the result with
    an upper case as well, which I didn't do, since I figured that you
    knew how to do that.
    Phil

  • Need help with upper case

    I'm stuck on my coding when I have to write a function to
    detect upper cases has been used in a sentence
    For example if my array element has this:
    2345
    SAINT PAUL
    STREET
    APT 5
    PHILADELPHIA
    I need to be able to write a code to let me know that the 2nd
    OR 3rd OR 5th element is written in upper case letter
    Or if I set the variable not as array, 2345 SAINT PAUL STREET
    APT 5 PHILADELPHIA
    I need to be able to detect that at least one of the section
    on that street name is written with upper case
    Can anyone help please?

    compare() cf function performs a case-sensitive comparison of
    2 strings
    and returns 0 is the strings are the same. so you can compare
    an
    uppercase version of the string to the original string, and
    if the
    comparison returns 0 then your string is in uppercase:
    <cfif compare(ucase(myarray[2]), myarray[2]) is 0>
    <!--- the string in myarray[2] IS in uppercase --->
    <cfelse>
    <!--- it is NOT in uppercase --->
    </cfif>
    the above code compares the value of the second array element
    converted
    to uppercase to the original value of the second array
    element. if the
    result is 0, i.e. the uppercase and original strings are the
    same, then
    you know the original string is in uppercase.
    if you are dealing with a single string (which is equivalent
    to a
    space-delimited list), then use appropriate list function to
    get
    required list element, i.e. listfirst(), listlast(),
    listgetat()...
    <cfif compare(ucase(listlast(mylist, " ")),
    listlast(mylist, " ")) is 0>
    <!--- the last element in the list IS in uppercase --->
    <cfelse>
    <!--- it is NOT in uppercase --->
    </cfif>
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/

  • Migrating a Sybase Index with ignore_dup_key

    HI All,
    I am involved with Sybase to Oracle migration.
    I need to migrate a Index with ignore_dup_key.
    I am currently inserting the data into the table and then deleting the duplicate enteries.
    Can someone suggest me a better approach..
    Thanks,
    Riddhisha
    Edited by: Riddhisha on Apr 13, 2012 3:18 PM

    I think there is some confusion around ignore_dup_key functionality. Ignore_dup_key in Sybase essentially allows an application to continue without aborting a on-going transaction even if there was an attempt to insert duplicate values for columns that have a Unique index on them with ignore_dup_key clause. But (I emphasize) Sybase does not allow duplicate values in a column on which a unique index exists.
    Typically when you try to insert duplicate values for columns with unique/primary indexes, you get a "unique constraint violation error". This error under normal conditions will result in the failure of the complete transaction. With IGNORE_DUP_KEY clause, the sybase database simply ignores that "INSERT/UPDATE" statement and continues with the rest of the transaction.
    What that means is if you have a index on a table in Sybase with Ignore_dup_key clause then most likely that index is a UNIQUE index. So that means you shouldn't see duplicate values in the affected column(s). If you do see duplicate values then the implication is that the index is not a UNIQUE index and hence IGNORE_DUP_KEY clause does not really add value. Customer may have changed their schema design later realizing that those columns will have duplicate values but forgot to take out the IGNORE_DUP_KEY clause. Also if you already have duplicate values for a column, you cannot create a UNIQUE index even in Sybase with this clause.
    Since you are seeing duplicate values in the table so I am guessing that it is a regular B*tree index so you can do the same in Oracle and ignore the IGNORE_DUP_KEY clause as Oracle does not offer such functionality.
    If you really want to create a unique index in Oracle and not have the duplicate values then you will have to try couple of different approaches. Create an External table and use PL/SQL procedure/function to load the data using MERGE statements or INSERT INTO... SELECT FROM EXTERNAL_TABLE with the LOG ERROR Clause to reject the duplicate values without failing the overall data load.
    Hope this helps..
    Regards
    Prakash

  • Error when creating index with parallel option on very large table

    I am getting a
    "7:15:52 AM ORA-00600: internal error code, arguments: [kxfqupp_bad_cvl], [7940], [6], [0], [], [], [], []"
    error when creating an index with parallel option. Which is strange because this has not been a problem until now. We just hit 60 million rows in a 45 column table, and I wonder if we've hit a bug.
    Version 10.2.0.4
    O/S Linux
    As a test I removed the parallel option and several of the indexes were created with no problem, but many still threw the same error... Strange. Do I need a patch update of some kind?

    This is most certainly a bug.
    From metalink it looks like bug 4695511 - fixed in 10.2.0.4.1

  • Can we associate index with foreign key?

    hello
    i have searched and could not find the answer to the above;
    i have a foreign key constraint on the tables; i added an index on that column as well;
    however when i query the all_constraints, under index_name for this foreign constraint there is nothing; only when i have PK/UK i case see indexes associated with them;
    will then oracle still associate my index with the FK constrained column? or i need to excplicity associate it with the foreign key column? if so, how to do that?
    thx
    rgds

    Hi,
    UserMB wrote:
    i have a foreign key constraint on the tables; i added an index on that column as well;It helps if you give a specific example, such as:
    "I have a foreign key constraint, where emp.deptno references dept.deptno. (Deptno is the primary key of dept.) I created an index called emp_deptno_idx on emp.deptno as well."
    however when i query the all_constraints, under index_name for this foreign constraint there is nothing; only when i have PK/UK i case see indexes associated with them;Not all indexes are associated with a constraint. In the example above, you wouldn't expect to see anything about the index emp_demptno_idx in all_constraints or in all_cons_columns.
    will then oracle still associate my index with the FK constrained column? or i need to excplicity associate it with the foreign key column? if so, how to do that?In the situation above, Oracle will still use the index when the optimizer thinks it will help. You don't have to do anything else.

  • Problem generating index with 2th level in cs4

    Windows XP sp 3 - Indesign CS4 601
    When generating an index with a 1st and a 2th level, in the 2th level the entry of the 1st entry is always repeated.
    E.g. the index should look as this:
    text     75
         capitalized     76
         import     78
    word     105
         language     108
         meaning     109
    But actually the index looks as this:   
    text     75
         textcapitalized     76
         textimport     78
    word     105
         wordlanguage     108
         wordmeaning     109
    Is this a bug, or is there a solution for it?
    Thanks for your help!
    Luc Van de Cruys
    phaedra creative communications

    Oops!
    Just tested the script.
    I run it, and I get the script alert 'All Done' at the end.
    But nothing happens.
    This is what I do:
    - I generate the index.
    - I select the index with the text tool (select all or just put the textcursor somewhere in the index makes no difference).
    - I run the script
    - I get the message 'all done', but there is no difference. The problem persists.
    Any other ideas?
    Thanks anyway.
    L.L.

  • Performance - composite index with 'OR' in 'WHERE' clause

    I have a problem with the performance of the following query:
    select /*+ index_asc(omschact oma_index1) */ knr, projnr, actnr from omschact where ((knr = 100 and actnr > 30) or knr > 100)
    and rownum = 1;
    (rownum used only for test purpose)
    index:
    create index on omschact (knr, projnr);
    Execution plan:
    Id Operation
    0 SELECT STATEMENT
    1 COUNT STOPKEY
    2 TABLE ACCESS BY INDEX ROWID
    3 INDEX FULL SCAN
    If I'm correct, the 'OR' in the 'WHERE' clause is responsible for the INDEX FULL SCAN, what makes the query slow.
    A solution would be then to separate the 'WHERE' clause in 2 separate select's (1 with 'knr = 100 and actnr > 30' and 1 with 'knr > 100' and combine the results with a UNION ALL.
    Since it's necessary to have all rows in ascending order (oma_index1) I still have to use an ORDER BY to make sure the order of the rows is correct. This results again in a (too) low performance.
    Another solution that does the trick is to create an index with the 2 fields (knr, projnr) concatenated and to use the same in the 'WHERE' clause:
    create index oma_index2 on omschact (knr || projnr);
    select /*+ index_asc(omschact oma_index2) */ knr, projnr, actnr from omschact where (knr || projnr) > 10030;
    I just can't believe this work-around is the only solution, so I was hoping that someone here knows of a better way to solve this.

    padders,
    I'll give the real data instead of the example. The index I really use consists of 4 fields. In this table the fields are just numbers, but in other tables I need to use char-fields in indexes, so that's why I concatenate instead of using formula's (allthough I would prefer the latter).
    SQL> desc omschact
    Name Null? Type
    KNR NOT NULL NUMBER(8)
    PROJNR NOT NULL NUMBER(8)
    ACTNR NOT NULL NUMBER(8)
    REGELNR NOT NULL NUMBER(3)
    REGEL CHAR(60)
    first methode:
    SQL> create index oma_key_001(knr,projnr,actnr,regelnr);
    Index created.
    SQL> select /*+ index_asc(omschact oma_key_001) */ * from omschact where
    2 (knr > 100 or
    3 (knr = 100 and projnr > 30) or
    4 (knr = 100 and projnr = 30 and actnr > 100000) or
    5 (knr = 100 and projnr = 30 and actnr = 100000 and regelnr >= 0));
    Execution Plan
    Plan hash value: 1117430516
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 11M| 822M| 192K (1)| 00:38:26 |
    | 1 | TABLE ACCESS BY INDEX ROWID| OMSCHACT | 11M| 822M| 192K (1)| 00:38:26 |
    |* 2 | INDEX FULL SCAN | OMA_KEY_001 | 11M| | 34030 (1)| 00:06:49 |
    Predicate Information (identified by operation id):
    2 - filter("KNR">100 OR "KNR"=100 AND "PROJNR">30 OR "KNR"=100 AND "PROJNR"=30
    AND "ACTNR">100000 OR "ACTNR"=100000 AND "KNR"=100 AND "PROJNR"=30 AND
    "REGELNR">=0)
    second method (same index):
    SQL> select * from (
    2 select /*+ index_asc(omschact oma_key_001) */ * from omschact where knr > 100
    3 union all
    4 select /*+ index_asc(omschact oma_key_001) */ * from omschact where knr = 100 and projnr > 30
    5 union all
    6 select /*+ index_asc(omschact oma_key_001) */ * from omschact where knr = 100 and projnr = 30 and actnr > 100000
    7 union all
    8 select /*+ index_asc(omschact oma_key_001) */ * from omschact where knr = 100 and projnr = 30 and actnr = 100000 and regelnr > 0)
    9 order by knr, projnr, actnr, regelnr;
    Execution Plan
    Plan hash value: 292918786
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 11M| 1203M| | 477K (1)| 01:35:31 |
    | 1 | SORT ORDER BY | | 11M| 1203M| 2745M| 477K (1)| 01:35:31 |
    | 2 | VIEW | | 11M| 1203M| | 192K (1)| 00:38:29 |
    | 3 | UNION-ALL | | | | | | |
    | 4 | TABLE ACCESS BY INDEX ROWID| OMSCHACT | 11M| 822M| | 192K (1)| 00:38:26 |
    |* 5 | INDEX RANGE SCAN | OMA_KEY_001 | 11M| | | 33966 (1)| 00:06:48 |
    | 6 | TABLE ACCESS BY INDEX ROWID| OMSCHACT | 16705 | 1272K| | 294 (1)| 00:00:04 |
    |* 7 | INDEX RANGE SCAN | OMA_KEY_001 | 16705 | | | 54 (0)| 00:00:01 |
    | 8 | TABLE ACCESS BY INDEX ROWID| OMSCHACT | 47 | 3666 | | 4 (0)| 00:00:01 |
    |* 9 | INDEX RANGE SCAN | OMA_KEY_001 | 47 | | | 3 (0)| 00:00:01 |
    | 10 | TABLE ACCESS BY INDEX ROWID| OMSCHACT | 1 | 78 | | 4 (0)| 00:00:01 |
    |* 11 | INDEX RANGE SCAN | OMA_KEY_001 | 1 | | | 3 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    5 - access("KNR">100)
    7 - access("KNR"=100 AND "PROJNR">30)
    9 - access("KNR"=100 AND "PROJNR"=30 AND "ACTNR">100000)
    11 - access("KNR"=100 AND "PROJNR"=30 AND "ACTNR"=100000 AND "REGELNR">0)
    third method:
    SQL> create index oma_test(to_char(knr,'00000000')||to_char(projnr,'00000000')||to_char(actnr,'00000000')||to_char(regelnr,'000'));
    Index created.
    SQL> select /*+ index_asc(omschact oma_test) */ * from omschact where
    2 (to_char(knr,'00000000')||to_char(projnr,'00000000')||
    3 to_char(actnr,'00000000')||to_char(regelnr,'000')) >=
    4 (to_char(100,'00000000')||to_char(30,'00000000')||
    5* to_char(100000,'00000000')||to_char(0,'000'))
    Execution Plan
    Plan hash value: 424961364
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 553K| 55M| 1712 (1)| 00:00:21 |
    | 1 | TABLE ACCESS BY INDEX ROWID| OMSCHACT | 553K| 55M| 1712 (1)| 00:00:21 |
    |* 2 | INDEX RANGE SCAN | OMA_TEST | 99543 | | 605 (1)| 00:00:08 |
    Predicate Information (identified by operation id):
    2 - access(TO_CHAR("KNR",'00000000')||TO_CHAR("PROJNR",'00000000')||TO_CHAR("
    ACTNR",'00000000')||TO_CHAR("REGELNR",'000')>=TO_CHAR(100,'00000000')||TO_CHAR(3
    0,'00000000')||TO_CHAR(100000,'00000000')||TO_CHAR(0,'000'))

  • How to check for a function module with its description and functionality

    Hi all,
    How to check for a function module,with its description and its functionality,in detail how can I know the purpose of a particular function module,how to search for a function module which suits my requirement .

    Hi,
    You can search a FM of your requirement by putting in the Key words and searching for a FM. Like * KEYWORD * and then pressing F4.
    Say for example you need to search something regarding converstion.
    Search for * CONVERT * and press F4.
    If there is something specfic like converting date to something you can give
    DATE * CONVERT *
    OR
    CONVERT * DATE *  and press F4.
    Once you narrow down your search you will have a Function module documentation inside the Function module. Please note that all the FMs willl not have documentation.
    Regards,
    Pramod

Maybe you are looking for