What is use of index by binaary_integer

Hi All,
I have created to program of collection where we use index by binaary_integer in one program and not use index by binaary_integer in second program, but result is same, any body help me what is use of index by binaary_integer here
1- Declare
Type emp_table_type is table of
emp%rowtype index by binary_integer;
my_emp_table emp_table_type;
Begin
select * bulk collect into my_emp_table from emp;
for i in my_emp_table.first..my_emp_table.last
loop
dbms_output.put_line(my_emp_table(i).ename);
end loop;
end;
2- Declare
Type emp_table_type is table of
emp%rowtype;
my_emp_table emp_table_type;
Begin
select * bulk collect into my_emp_table from emp;
for i in my_emp_table.first..my_emp_table.last
loop
dbms_output.put_line(my_emp_table(i).ename);
end loop;
end;
your suggestion would be greatly appreciated.

here is one for you.
http://download.oracle.com/docs/cd/E11882_01/appdev.112/e17126/composites.htm#CHDEIDIC

Similar Messages

  • What is the use of Indexes in ODS&Infocube??

    What is the use of Indexes in ODS&Infocube??

    An Index can improve the reading performance when data is searched for values of fileds contained in the index.
    The fact whether the Index is used or not depends on the database optimizer, which decides it after taking the following under consideration:
    - Size of the table
    - Fields in the index compared to the fields in the statement
    - The quality of the index (its clustering factor)
    One backdraw of Index is that they decrease writing performance, as they are maintained during the write to the table.
    Hope it helps you,
    Gilad

  • How to use cfloop index value as part of another variable

    Hello,
    I have a RATE form that first asks "how many rates will you
    be adding?" that answer generates a series of form elements based
    on the answer. You then have a form grid to populate, 3 values for
    each rate (price, code, name).
    This part works fine. The issue is now I need to INSERT the
    values into the table, so I need to use the INDEX value of the
    cfloop to recreate the amount (and names) of the fields in the
    INSERT statement. How do I escape, or re-create the evaluated form
    elements ( in which their count is #i# as the loop goes) when I
    need to evaluate for #i# AND evaluate for #form.sku_i_name# at the
    same pass?
    I am passing, for example, #form.sku_2_Name# where that might
    equal "Half Page". The number 2 in that variable was assigned
    during the form creation by the current index of a cfloop. Since my
    action (insert) page does not know how many (out of 50 possible)
    sku's are coming, how do I use the skuCount (another hidden value
    passed as well) to create a proper INSERT SQL command when I need
    to eval the form element and the index at the same time?
    Obviously #sku_#i#_Name# does not work, and #sku_i_Name# does
    not either... I know this can be done, and that I am just doing it
    wrong.
    Thanks for any help!

    bigbrain28 wrote:
    > Thank You, cfsearching! I don't quite understand 100%
    how it works
    As all three of us indicated you use array notation for this
    type of
    requirement. In ColdFusion you can use array notation or dot
    notation
    to access structure data. Almost all data in ColdFusion is
    now some
    type of structure.
    I.E. #Form['myField']# is the same as #Form.myField#.
    The advantage is that with array notation you can do things
    you can not
    do with dot notation. You can reference elements that have
    keys that
    are illegal variable names such as one with a space.
    I.E. #url['my field'] is allowed, #url.my field# would fail
    or course.
    And you can concatenate the key string as we did with your
    example.
    I.E. #Form['aString' & aVariable]#
    There are many powerful things one can do with this
    knowledge. One can
    access record sets with array notations. This can allow for
    very
    sophisticated parsing of a record set.
    I.E. #myQuery['column'][row]#
    You can dynamical call a variable. Thus creating dynamic code
    that does
    not even need to know what variables exist until run time.
    I.E. #variables[anyName]#
    This just scratches the surface.

  • WHat is the best index type for non uniqueness / Varchar columns in SQL 2008 R2

    Hello All Greetings,
    Please help me here with my doubt,
    in my table i have two columns about a million rows, it has about 20 columns in it, three columns with name as Period, Gender so most of the time these two columns use in where clause,
    Gender  will contain Either M or F , Period contains YYYY-Month (2013-December, 2013-August) etc so i would like to add a Index to these two columns so that in will increase the performance, so please let me know what type of indexes i need to add to
    these columns in the table,
    please note that only one time we will add data to the table which will take only 2 minutes but we query the table every day
    so my question what is the best index type that i need to create on columns with non uniqueness values in the column.,
    Thank you In Advance,
    Milan

    There is nothing whatever wrong with creating an index on a VARCHAR column, or set of columns.
    Regarding the performance of VARCHAR/INT, as with everything in a RDBMS, it depends on what you are doing. What you may be thinking of is the fact that clustering a table on a VARCHAR key is (in SQL Server) marginally less efficient than clustering on a monotonically
    increasing numerical key, and can introduce fragmentation.
    Or you may be thinking of what you have heard about writing JOINs on VARCHAR columns - it is true, it is a little less efficient than a JOIN on numeric type, but it is only a little less efficient, nothing that would lead you to never join on varchar cols.
    None of this does not mean that you should not create indexes on VARCHAR columns. A needed index on a VARCHAR column will boost query performance, often by orders of magnitude. If you need an index on a VARCHAR, create it. It makes no sense to try to find an
    integer column to create the index on - the engine will never use it.
    Check this reference: http://stackoverflow.com/questions/14041481/is-it-good-to-create-a-nonclustered-index-on-a-column-of-type-varchar
    Mark ANSWER if this reply resolves your query, If helpful then VOTE HELPFUL
    INSQLSERVER.COM
    Mohammad Nizamuddin

  • How to use the index method for pathpoints object in illustrator through javascripts

    hii...
    am using Illustrator CS2 using javascripts...
    how to use the index method for pathpoints object in illustrator through javascripts..

    Hi, what are you trying to do with path points?
    CarlosCanto

  • How do I use the Index Values property node with a multidimensional array.

    I am using a 2D array to store operator inputs on my front panel.  I only want to display one element to the operator at a time.  I am trying to use the Index Values property node to change the displayed element.  However, I can only get the Rows index to work.  How do I direct the Columns index as well?  The help says to use one per dimension.  I need clarification on what this is talking about.  I've tried adding a second element to the property node, 2 seperate property nodes, and diferent wiring techniques. (series, parallel)

    If you only wire up one of the inputs (col or row) what you get out is a 1D array of either the column or row. If you wire controls to both, then you will get one element out of the array. Getting a single element in a 2D array requires you to specify both a row and column.
    Message Edited by Dennis Knutson on 02-08-2007 08:34 AM
    Attachments:
    Index 2D Array.PNG ‏2 KB

  • Retrieving specific document using explicit index lookup

    The best way to retrieve a specific document seems to be using XmlContainer::getDocument, thus using the default index.
    However, I may not have the document name, but instead an ID I have defined a unique index for.
    Of course, I can use the XQuery interface to retrieve the document, and it's fast.
    It's faster, though, to directly use an index. I can use XmlContainer::lookupIndex in order to do this; it takes an optional parameter "value", and the documentation for 2.3.10 says: "Provides the value to which equality indices must be equal. This parameter is required when returning documents on equality indices, and it is ignored for all other types of indices."
    However, the documentation also says that XmlContainer::lookupIndex is deprecated, "in favor of using XmlManager::createIndexLookup and XmlIndexLookup::execute". That recommended approach does not seem to provide a way to look up a specific value. It seems I have to iterate over the index, which is not what I want. Am I missing something?
    Michael Ludwig

    George,
    thanks a lot - should have found this myself, I guess. Working example following:
    use strict;
    use warnings;
    use Sleepycat::DbXml 'simple';
    my $id = shift or die "usage: $0 <ID>\n";
    my $contfile = $ENV{HOME} . '/dbenv/tv.dbxml';
    my $iuri = ''; my $iname = 'ID';
    my $istrat = 'unique-node-attribute-equality-decimal';
    eval {
        my $mgr = XmlManager->new;
        my $cont = $mgr->openContainer($contfile, Db::DB_RDONLY);
        my $sval = XmlValue->new(XmlValue::DECIMAL, $id);
        my $idx = $mgr->createIndexLookup($cont, $iuri, $iname, $istrat, $sval);
        my $ctx = $mgr->createQueryContext(
            XmlQueryContext::LiveValues,
            XmlQueryContext::Lazy);
        my $res = $idx->execute($ctx);
        while ($res->hasNext) {
            $res->next(my $val);
            print $val;
    my $ex;
    if ($ex = catch XmlException) {
        die join "\n", ref $ex, $ex->what,
            'Exception Code: ' . $ex->getExceptionCode,
            'DbErrno: ' . $ex->getDbErrno;
    elsif ($ex = catch std::exception) { die join "\n", ref $ex, $ex->what }
    elsif ($@)                         { die $@ }For an alternative approach using setLowBound(), apply the following diff:
    12c12,13
    <     my $idx = $mgr->createIndexLookup($cont, $iuri, $iname, $istrat, $sval);
    my $idx = $mgr->createIndexLookup($cont, $iuri, $iname, $istrat);
    $idx->setLowBound( $sval, XmlIndexLookup::EQ );Thanks,
    Michael

  • Selecting all columns makes oracle use more indexes than only selectng one?

    I have 3 queries here that differ only slightly, conceptually, but the plans are massively different. What I cant work out is that the difference is only in the select list.. The fields referenced in the where clause are properly indexed for this purpose
    SELECT
      scc.expiry_date
    FROM
      bw3.int_file_log_details  ifld
      INNER JOIN
      bw3.svc_card_status_change scsc
      USING
        (institution_number, file_number)
      INNER JOIN bw3.svc_client_cards scc
      USING
        (card_number)
    WHERE
      institution_number = '00000001' AND
      file_number = '00002504'This one above does a full table scan of SCC, over 3.5 million records
    SELECT
      card_number
    FROM
      bw3.int_file_log_details  ifld
      INNER JOIN
      bw3.svc_card_status_change scsc
      USING
        (institution_number, file_number)
      INNER JOIN bw3.svc_client_cards scc
      USING
        (card_number)
    WHERE
      institution_number = '00000001' AND
      file_number = '00002504'This one above does an index fast full scan of SCC's pk (which is cardnumber), as does doing a "SELECT null as dummy FROM..."
    SELECT
    FROM
      bw3.int_file_log_details  ifld
      INNER JOIN
      bw3.svc_card_status_change scsc
      USING
        (institution_number, file_number)
      INNER JOIN bw3.svc_client_cards scc
      USING
        (card_number)
    WHERE
      institution_number = '00000001' AND
      file_number = '00002504'This one above does the index range scan of the columns mentioned in the where clause and two index unique scans to link in IFLD and SCC (because they are joined on their PKs)
    I would expect all queries to run this way and completes in ~0.01 seconds
    Now, I get that oracle will sometimes use only an index instead of a table access when the requested data can be got from the index, but the actual query is pulling data from some columns not in indexes, so must be accessed in the table:
    SELECT
      scsc.card_prod_data as "Field1",
      substr(card_number,1,4)||' '||
        substr(card_number,5,4)||' '||
        substr(card_number,9,4)||' '||
        substr(card_number,13,4)||' '||
        substr(card_number,17) as "Field2",
      '                           ' as "Field3",
      scc.emboss_line_1 as "Field4",
      scc.emboss_line_2 as "Field5",
      TO_CHAR(TO_DATE(scc.last_issued_date, 'YYYYMMDD'), 'MM/YY ')||
        TO_CHAR(TO_DATE(scc.expiry_date, 'YYYYMMDD'), 'MM/YY  ')||
        '    ' as "Field6",
      'B'||
        card_number||
        '^'||
        RPAD('0', 27, ' ')||
        '^'||
        to_char(to_date(scc.expiry_date, 'YYYYMMDD'), 'YYMM')||
        service_category_code||
        '000000000000' as "Field7",
      card_number||
        '='||
        to_char(to_date(scc.expiry_date, 'YYYYMMDD'), 'YYMM')||
        service_category_code||
        '000000000000' as "Field8",
      card_number as "Field9",
      scsc.cvv_cvc2 as "Field10"
    FROM
      bw3.int_file_log_details  ifld
      INNER JOIN
      bw3.svc_card_status_change scsc
      USING
        (institution_number, file_number)
      INNER JOIN bw3.svc_client_cards scc
      USING
        (card_number)
    WHERE
      institution_number = '00000001' AND
      file_number = '00002504'This query above, which uses some data from all tables, does a table full scan of SCC, yet if I SELECT * FROM.. I get the expected index usage and table access by index rowid for all tables..
    Why is oracle doing an FTS when I choose only some columns, yet doing index access when I select * ?
    Edited by: charred on Oct 5, 2010 11:37 AM

    Selectivity of indexes?
    For a query linking these tables:
    int_file_log_details <-> svc_card_status_change <-> svc_client_cards
    I'm expecting Oracle to:
    Use an index range scan of the index on svc_card_status_change that is a nonunique index of institution_number and file number. Selectivity of this index is:
    1 institution number in the entire table
    59 distinct file numbers in the entire table
    4.1million records in the entire table
    From there, with the records it found, to use index unique scan of the PKs of int_file_log_details (file_number: 1 record required) and PK of svc_client_cards (card_number: poetntially thousands of records required)
    I can understand if oracle might decide it can get 69k records out of 4.1 million faster by FTS the cards table rather than having the indirection of the index... what I cannot understand is:
    If I select all the data from the query (SELECT *) it does unique index scans for the 2 records
    If I select say, only one non-indexed non-joined column from each table, oracle prefers a FTS of the cards table..
    Is oracle not realising that there are only 2 records I need out of cards? Why would select * differ? Is it that oracle thinks "select * is a large amount of data, so it'll be faster to use the index and target certain rows" vs "select one_column can be garnered more quickly by scanning the table and generating a lower overall memory load" ?

  • Simple SQL Query is not using Bitmap index

    Hello to All,
    We are having Oracle9i Database and using it for the datawarehouse purpose.
    I have created the bitmap index on calledinfo column and I am running the following simple query which takes serveral hours to complete:
    select * from ssp.ssp_2006_q4 where calledinfo='799992515f'
    OR
    select calledinfo from ssp.ssp_2006_q4 where calledinfo='799992515f'
    I don't know why it is not using the bitmap index: Can anybody help me here?
    Thanks in Advance
    Hashim

    I know why and everyone that has read Jonathan Lewis' book on the CBO knows why.
    Why? Because the CBO thinks the cost of using your index will be higher than the cost of ignoring it.
    To see what Oracle is thinking run an explain plan using DBMS_XPLAN for create the output and then rerun it with a hint forcing index usage.
    It is a mistake to believe that an index will always make things better. Issues of cardinality, clustering factor, etc. are very important.
    Post the explain plans if you have any questions about what they show:
    http://www.psoug.org/reference/explain_plan.html

  • Query uses wrong index

    Hi,
    I have exported and imported two schemas to a different server. Now when a user fires a select query it takes more time than before. When I saw the execution plan for some of 'select' queries,I found that the queries are using wrong index.This is the reason for the delayed reponse time.
    Can anybody tell me why it happened ?
    Now what should I do?
    Can I force select query to use the right index?
    Thanx in advance

    Please find below details of the query and indexes. Do let me know if you need more information.
    Query:
    SELECT ROWID, warehouse_code, branch_code, client_code, job_srnum,
    department, inventory_date, file_no, client_carton_no, description,
    ref1, ref2, ref3, destruction_date, subject, pnw_carton_no,
    cre_user_id, cre_dt, upd_user_id, branch, upd_dt, status, date1,
    date2, num1, carton_size, addendum_date
    FROM ISTORET.rmst_inventory_details2
    WHERE branch_code = 'BOM'
    AND job_srnum = '62100113476'
    AND client_carton_no = 'BM4060394822'
    AND subject = 'FILES'
    ORDER BY file_no
    Execution Plan:
    Operation Object Name Rows Bytes Cost
    SELECT STATEMENT Optimizer Mode=CHOOSE 1 15
    SORT ORDER BY 1 155 15
    TABLE ACCESS BY INDEX ROWID ISTORET.RMST_INVENTORY_DETAILS2 1 155 5
    INDEX RANGE SCAN ISTORET.BRC_JOB_SUB_REF123_INDX 1 4
    Query time: More than 5 mins
    Same query with hint /*+ index(rmst_inventory_details2 BRC_JOB_CTN_FILE_INDX) */
    SELECT STATEMENT Optimizer Mode=CHOOSE 1 6
    TABLE ACCESS BY INDEX ROWID ISTORET.RMST_INVENTORY_DETAILS2 1 155 6
    INDEX RANGE SCAN ISTORET.BRC_JOB_CTN_FILE_INDX 1 5
    Query time: 110 msecs
    Index details:
    PARAMETER INDEX- 1 INDEX- 2
    Table Owner ISTORET ISTORET
    Table Name RMST_INVENTORY_DETAILS2 RMST_INVENTORY_DETAILS2
    Index Name BRC_JOB_CTN_FILE_INDX BRC_JOB_SUB_REF123_INDX
    Uniqueness NONUNIQUE NONUNIQUE
    Columns BRANCH_CODE
    JOB_SRNUM
    CLIENT_CARTON_NO
    FILE_NO BRANCH_CODE
    JOB_SRNUM
    SUBJECT
    REF1
    REF2
    REF3
    Table Type TABLE TABLE
    Status VALID VALID
    Tablespace ISTORET_RID2_INDX ISTORET_RID2_INDX
    Initial Extent Size 4,194,304 4,194,304
    Next Extent Size 4,194,304 4,194,304
    Minimum Extents 1 1
    Maximum Extents 2,147,483,645 2,147,483,645
    Percent Increase 0 0
    Distinct Keys 42,576,227 27,318,132
    Percent Free 10 10
    Index Type NORMAL NORMAL
    Partitioned No No
    Temporary No No
    Join Index No No
    Size in MB 2,456 2,140
    Number Extents 614 535
    Size in bytes 2,575,302,656 2,243,952,640
    Last Analyzed 20/3/2007 20/3/2007

  • Why is Oracle not using the index??

    Hi,
    I have a table called 'arc_errors' which has an index on 'member_number' as follows:- Create/Recreate indexes
    create index DWO.DW_ARC_CERRORS_MNO on DWO.DW_ARC_CERRORS (MEMBER_NUMBER);
    But surpisingly, when I execute the following query, it does not use the index.
    SELECT member_number,
    COUNT(*) error_count
    FROM arc_errors a
    WHERE member_number = 68534152 AND
    ( tx_type = 'SDIC' AND
    error_number IN (4, 7, 12, 13, 15, 17, 18, 705) )
    OR
    ( tx_type = 'AUTH' AND
    error_number IN (100, 104, 107, 111, 116) )
    OR
    ( tx_type = 'BHO' AND
    error_number IN (708,710) )
    OR
    ( tx_type = 'XLGN' AND
    ( error_number BETWEEN 102 AND 105 OR
    error_number BETWEEN 107 AND 120 OR
    error_number BETWEEN 300 AND 304 ) )
    OR
    ( tx_type = 'None' AND
    ( error_number IN (20, 112) OR
    error_number BETWEEN 402 AND 421 ) )
    OR
    ( tx_type = 'HYBR' AND
    error_number IN (303, 304) )
    GROUP BY member_number;
    This is what 'explain plan' tell me
    SELECT STATEMENT, GOAL = RULE               237907     502923     15087690     
    SORT GROUP BY               237907     502923     15087690     
    PARTITION RANGE ALL                              
    TABLE ACCESS FULL     DWO     DW_ARC_CERRORS     237209     502923     15087690     
    Can someone tell me why a 'table acess full' is required here?
    Thanks in advance,
    Rajesh

    Sorry, I just found the solution myself. I need to put an extra pair of braces around the set of conditions seperated by OR.

  • 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/

  • Why my query not using any index but doing a FULL TABLE SCAN

    Hi,
    My EXPLAIN PLAN output is
    Plan hash value: 1163866984                                                                                                                                                                                                                                                                                 
    | Id  | Operation               | Name              | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |                                                                                                                                                                                                       
    |   0 | SELECT STATEMENT        |                   |   774 |   159K|       | 40847   (2)| 00:08:11 |                                                                                                                                                                                                       
    |*  1 |  FILTER                 |                   |       |       |       |            |          |                                                                                                                                                                                                       
    |   2 |   SORT GROUP BY         |                   |   774 |   159K|       | 40847   (2)| 00:08:11 |                                                                                                                                                                                                       
    |*  3 |    HASH JOIN            |                   | 77337 |    15M|  9744K| 40843   (2)| 00:08:11 |                                                                                                                                                                                                       
    |*  4 |     HASH JOIN           |                   | 77337 |  8836K|  5896K| 20987   (2)| 00:04:12 |                                                                                                                                                                                                       
    |*  5 |      HASH JOIN          |                   | 77337 |  4984K|       |  9292   (3)| 00:01:52 |                                                                                                                                                                                                       
    |*  6 |       HASH JOIN         |                   | 24991 |   951K|       |  3349   (3)| 00:00:41 |                                                                                                                                                                                                       
    |*  7 |        TABLE ACCESS FULL| IDS_TXNIDNUMBERS  | 24991 |   683K|       |  2328   (3)| 00:00:28 |                                                                                                                                                                                                       
    |   8 |        TABLE ACCESS FULL| IDS_TXNDEMDATAMAP |  2419K|    25M|       |  1006   (3)| 00:00:13 |                                                                                                                                                                                                       
    |   9 |       TABLE ACCESS FULL | IDS_IDNUMBERS     |  7435K|   191M|       |  5903   (2)| 00:01:11 |                                                                                                                                                                                                       
    |  10 |      TABLE ACCESS FULL  | IDS_DEMDATA       |  2583K|   125M|       |  3683   (5)| 00:00:45 |                                                                                                                                                                                                       
    |  11 |     TABLE ACCESS FULL   | IDS_TXN           |  2583K|   231M|       |  6403   (1)| 00:01:17 |                                                                                                                                                                                                       
    -----------------------------------------------------------------------------------------------------  All my 5 tables IDS_TXNIDNUMBERS, IDS_TXNDEMDATAMAP, IDS_IDNUMBERS,IDS_DEMDATA, IDS_TXN has indexes in relevant columns. Is it cause less time so CBO is not using the indexes.
    Thanks
    Amitava.

    amitavachatterjee1975 wrote:
    Please be polite when responding to my queries. If you find these questions not to your standard, stay away from them. This is an open forum and I have got my full rights to ask questions.Unsure, what wrong did you find in SB's reply. I find those links perfectly knowledgeable. The question of having so many unanswered questions probably pricked you a little too much. But that, IMO, is a legitimate question, to be asked to a User who even after being associated with OTN for over an year has 100% record of not getting an answer.
    For your original question, you will have to provide more details to allow people to answer you.
    You must read {message:id=3292438} and post the mentioned details. People do not carry a Crystal Ball to identify the problem merely by reading few lines of Problem description and Explain plans. Do not make people guess, provide appropriate details, to help them Help "You".

  • 10.2.0.3 does not use a index

    Hi
    I have a simple query which in 9i uses a index but after upgrading to 10.2.0.3 has stopped useing the index and instead prefers a hash join and a full table scan.
    Any idea if this is a bug in 10.2.0.3 or how do i go about doing this investigation
    SELECT sum((col1)/(col2+col1))*col1*100/(col3)
        FROM tab1a, tab2 b 
        WHERE     a.tab2_id  = b.id 
              AND a.col2 = 26538  
              AND b.col3    &gt; 0 
    | Id  | Operation                     | Name                     | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |
    |   1 |  SORT AGGREGATE               |                          |      1 |      1 |      1 |00:00:00.30 |   64362 |      2 |
    |   2 |   NESTED LOOPS                |                          |      1 |  23662 |  21348 |00:00:00.27 |   64362 |      2 |
    |   3 |    TABLE ACCESS BY INDEX ROWID| tab1                 |      1 |  23662 |  21348 |00:00:00.03 |     316 |      1 |
    |*  4 |     INDEX RANGE SCAN          | col2_idx    |      1 |  23662 |  21348 |00:00:00.01 |      51 |      0 |
    |*  5 |    TABLE ACCESS BY INDEX ROWID| tab2                |  21348 |      1 |  21348 |00:00:00.21 |   64046 |      1 |
    |*  6 |     INDEX UNIQUE SCAN         | tab2_PK             |  21348 |      1 |  21348 |00:00:00.12 |   42698 |      0 |
    Predicate Information (identified by operation id):
       4 - access("A"."col2"=26538)
       5 - filter("B"."col3"&gt;0)
       6 - access("A"."tab2_ID"="B"."ID")
    Plan in 10g 10.2.0.3
    PLAN_TABLE_OUTPUT
    Plan hash value: 2369063540
    | Id  | Operation                     | Name                     | Starts | E-Rows | A-Rows |   A-Time   | Buffers | Reads  |  OMem |  1Mem | Used-Mem |
    |   1 |  SORT AGGREGATE               |                          |      1 |      1 |      1 |00:00:45.80 |     196K|    193K|       |       |          |
    |   3 |    TABLE ACCESS BY INDEX ROWID| tab1                |      1 |  24189 |  21348 |00:00:00.02 |     318 |      0 |       |       |          |
    |*  4 |     INDEX RANGE SCAN          | col2_idx |      1 |  24189 |  21348 |00:00:00.01 |      51 |      0 |       |       |          |
    |*  5 |    TABLE ACCESS FULL          | tab2                |      1 |     12M|     12M|00:00:37.20 |     196K|    193K|       |       |          |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       2 - access("A"."tab2_ID"="B"."ID")
       4 - access("A"."col2"=26538)
       5 - filter("B"."col3"&gt;0)Any idea how do i find out why the index usage has been stopped

    Hi
    Here are the plans on the 10gr2 database with and without the hints.
    The index plan uses some milliseconds to get the answer whereas the full table acesses gets the result in about 2 minutes which is not acceptable
    I am trying to generate the 10053 trace
    I am not in favour of fiddling around with the Optimizer parameters as i am not sure what could go wrong with other queries
    | Id  | Operation                     | Name                     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |                          |     1 |    36 |  8955  (16)| 00:00:43 |
    |   1 |  SORT AGGREGATE               |                          |     1 |    36 |            |          |
    |*  2 |   HASH JOIN                   |                          | 24605 |   865K|  8955  (16)| 00:00:43 |
    |   3 |    TABLE ACCESS BY INDEX ROWID| tab1                     | 24605 |   360K|   374   (1)| 00:00:02 |
    |*  4 |     INDEX RANGE SCAN          | tab1_col2_I              | 24605 |       |    61   (2)| 00:00:01 |
    |*  5 |    TABLE ACCESS FULL          | tab2                     |    12M|   248M|  8398  (15)| 00:00:40 |
    Predicate Information (identified by operation id):
       2 - access("A"."tab2_ID"="B"."ID")
       4 - access("A"."col2"=31108)
       5 - filter("B"."col3">0)
    19 rows selected.
    Elapsed: 00:00:00.01
    explain plan for
    SELECT /*+ INDEX(b tab2_PK) */
         sum((col1)/(col2+col1))*col1*100/(col3)
    FROM tab1 a, tab2 b
    WHERE     a.tab2_id  = b.id
    AND a.col2 = 31108
    AND b.col3    > 0
    PLAN_TABLE_OUTPUT
    Plan hash value: 3651119713
    | Id  | Operation                     | Name                     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT              |                          |     1 |    36 | 49644   (1)| 00:03:56 |
    |   1 |  SORT AGGREGATE               |                          |     1 |    36 |            |          |
    |   2 |   NESTED LOOPS                |                          | 24605 |   865K| 49644   (1)| 00:03:56 |
    |   3 |    TABLE ACCESS BY INDEX ROWID| tab1                       | 24605 |   360K|   374   (1)| 00:00:02 |
    |*  4 |     INDEX RANGE SCAN          | tab1_col2_I            | 24605 |       |    61   (2)| 00:00:01 |
    |*  5 |    TABLE ACCESS BY INDEX ROWID| tab2                     |     1 |    21 |     2   (0)| 00:00:01 |
    |*  6 |     INDEX UNIQUE SCAN         | tab2_PK                  |     1 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access("A"."col2"=31108)
       5 - filter("B"."col3">0)
       6 - access("A"."tab2_ID"="B"."ID")
    20 rows selected.
    Elapsed: 00:00:00.01
    {code}
    regards
    Hrishy
    Edited by: hrishy on Dec 19, 2008 2:10 AM
    Edited by: hrishy on Dec 19, 2008 2:15 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • PL/SQL TABLE declarations must currently use binary_integer indexes

    Hi,
    I am having procedure written in form6i, this procedure is having pl/sql table datatyep "v_suppmesg orcl.err_message.error_tabtype;" this pl/sql datatype is defined in database and the procedure in database is not having any error in it.
    But when i am compling my form its giving me error
    PL/SQL TABLE declarations must currently use binary_integer indexes
    and error point is *"i_rowindex"* in the sentance given below.
    *"SET_GROUP_CHAR_CELL (g_suppress_error_colid, v_rowindex, v_suppmesg(i_rowindex));"*
    PROCEDURE PRC_A IS
    v_rowindex NUMBER (5,0) := 1;
    v_suppmesg orcl.err_message.error_tabtype;
    BEGIN
    g_suppress_error_rgid := FIND_GROUP (g_suppress_error_rgname);
    IF ID_NULL (g_suppress_error_rgid)
    THEN
    g_suppress_error_rgid := CREATE_GROUP (g_suppress_error_rgname, GLOBAL_SCOPE);
    g_suppress_error_colid := ADD_GROUP_COLUMN ( g_suppress_error_rgid
    , g_suppress_error_colname
    , CHAR_COLUMN
    , 15);
    orcl.err_message.get_messages (v_suppmesg);
    FOR i_rowindex IN 1..v_suppmesg.count
    LOOP
    ADD_GROUP_ROW (g_suppress_error_rgid, END_OF_GROUP);
    SET_GROUP_CHAR_CELL (g_suppress_error_colid, v_rowindex, v_suppmesg(i_rowindex));
    v_rowindex := v_rowindex + 1;
    END LOOP;
    ELSE
    g_suppress_error_colid := FIND_COLUMN (g_suppress_error_rgname||'.'||g_suppress_error_colname);
    END IF;
    END Init_Suppress_Message;
    can anyone tell me what's wrong in this.

    I have the folowing compiling and executing fine (Forms 10.1.2):
    DECLARE
      type t1 is table of VARCHAR2(100) index by BINARY_INTEGER ;
      tab t1;
      rg_id RecordGroup;
      gc_id GroupColumn; 
    BEGIN
         tab(1) := 'One' ;
         tab(2) := 'Two' ;
         tab(3) := 'Three' ;
         rg_id := FIND_GROUP ('RG10');
         IF ID_NULL (rg_id)
         THEN
              rg_id := CREATE_GROUP ('RG10', GLOBAL_SCOPE);
              gc_id := ADD_GROUP_COLUMN ( 'RG10'
              , 'COL1'
              , CHAR_COLUMN
              , 15);
              --orcl.err_message.get_messages (v_suppmesg);
              FOR i IN 1..tab.count
              LOOP
              ADD_GROUP_ROW ('RG10', END_OF_GROUP);
              SET_GROUP_CHAR_CELL ('RG10.COL1', i, tab(i));
              END LOOP;
         END IF;
    END;Francois

Maybe you are looking for

  • Lost all my contact in iphone

    I just went into itunes and must of click on the wrong box to update my new contacts that i put into my yahoo address book as i wanted to transfer all to iphone and when done it erased all of them, how do i get them all back

  • Add Custom field to standard screen with table control

    Hello, I need to add two custom fields to a standard screen in CAT2 transaction(not using any screen exit).I will be given SSCR key.The standard screen (screen no. 2100) only has a table control. How can I add the custom field such that it appears as

  • Camera file naming convension filename modification

    Hi, How do I change to photo's file naming convention? Each time I move my files to a centralised location, the filenames start from 001 again and now I have different photos with the same filename... STUPID!!!!

  • Hung up on array processing in PHP

    If I have a complex array that contains things like this - Array [0] => Array [0] => Array [id] => 1234567 [web_id] => 9876543 [something_id] => 656f3953bc [folder_id] => 0 [title] => Title 1 [type] => regular [create_time] => Jan 05, 2009 08:39 am [

  • Having a difficult time tethering Canon 6D to OS X 10.9.1 laptop.

    For a short time the tethering worked, but now it shows an error message that it cannot connect to camera.  Any thoughts?