Select using Indexed field, still using sequential read

Hi Experts,
I am selecting from CATSDB table
SELECT SINGLE *  FROM catsdb
          WHERE belnr = var.
BELNR is indexed so I am expecting that this statement will do a direct read.
But when this statement is run, SAP message indicates that
it is performing a sequential read.  Anybody knows why this is?  And how do I make direct read happen?
Thank you very much for your help.
Bes Regards,
Rose

Hi,
may be you need to update the database statistics for that table or you need to recreate the index. Check out db02 for the table or make some check using se14.
regards
Siggi
PS: Also fm rsdu_analyze_tables will be of some help. do a test run in se37 and enter the name of the table.
Message was edited by:
        Siegfried Szameitat

Similar Messages

  • Why should we select all key fields when using for all entries

    Hi,
    Why should we select all key fields in our select query when using for all entries statement?
    I read about for all entries but this point was not clear in any post.
    Please explain me
    Regards,
    Subhashini

    Dear Subhasini,
    It is because FOR ALL ENTRIES deletes the duplicate entries before populating the target internal table.
    Please do an F1 on FOR ALL ENTRIES & read the SAP documentation.
    I mean how duplicate entries will not get deleted when we use this?
    Quite simple, if you select  all key fields then each entry will be unique & there will not be any duplicate entries to delete !!
    BR,
    Suhas
    Edited by: Suhas Saha on Oct 16, 2009 9:41 AM

  • Signing: Empty list in "Field Selection" when picking fields to mark as read-only on signing

    I have a PDF form with some signature fields. I am attempting to mark some of the fields in the document as read-only when the document is signed. This is what I did:
    1. Modify the "Signed" properties of the signature field.
    2. Choose "Mark as read-only" and "Just these fields" in the drop down list beside this option.
    3. Click on the "Pick" button to select the fields to be marked read-only when the user signs this field.
    In the "Field Selection" dialog that comes up, nothing is shown in the list.
    Am I doing something wrong? Is there something I need to do to add fields to this list, or should it be populated automatically allowing me to choose what I want?
    I noticed this feature is only available for Acrobat 6.0 and later. The compatibility level for the document I created is 1.6 (Acrobat 7 and later). It is created in Acrobat X.
    Just figuring my way around these things. Did a google search for any solutions, but couldn't find anything on this.
    Any help would be greatly appreciated.
    Thanks,
    Ron

    Hi Ron,
    It certainly sounds like you are on the right track.What version of Acrobat are you using, is it Pro or Standard, Mac or Win? I see where you mentioned the file was created in Acrobat X, but I'm not sure that the app that create the PDF file is the same version as the one you are using for editing.
    Steve

  • Some websites I visit using safari are still using mobile mode

    Some websites im visiting are still using mobile mode instead of the normal website layout... ***** I thought all websites will be like normal just like browsing In net books

    I don't believe so. The iPad's OS is the iPhone's OS. Safari on the iPhone is detected a mobile browser, so the same must apply to Safari on the iPad. The iPad is not a netbook.
    If a website includes a full and mobile version, the website will be directed to the mobile version when using a mobile version of a browser. Most websites that include a full and mobile version also include an option to select the full version, which should be saved as a cookie when returning to the website.

  • Lookup using indexed fields

    I am doing a NamedCache.entryset(Filter) where I am trying to look up based on an indexed property. Is there a way to delegate this call to the backing cachestore if the cache is configured to have one? Right now, if its not found in the cache, it returns an empty set.
    Is there an alternate way or extra steps involved to achieve this, for searching in the back-store automatically if not found in the cache
    (for an index based search)
    Thank You

    Hi CoherenceUser
    Presumably you are asking if you can make Coherence search the underlying data source (e.g. the database) that you cache sits on top of. The short answer is no, you cannot.
    You could do something like a DB (SQL) query to give you back the keys and then do a getAll on the cache with this set of keys. Any entries not in the cache will then be loaded by the cache store. Obviously this makes your queries slower though.
    If you are going to query the cache then you need to make sure it is primed with all the data first.
    JK

  • How to assure index is being used for Query

    Hi All,
    Indexed are best way to speedup the data retrieval process selectively.
    however i wanted to how to trace that weather index is being used in a particular query.
    1. Table tab1 has composite index on a and b.
    2. Select a,b,c from tab1 where a>500 ;
    Will this query use index create from 1 ?
    Conceptually it should not because where as part contains only field A where as index is composit on field A and B.
    However , i wanted to know to trace that a perticual query is using index or not ?
    This question was asked to me in an interview.
    Pls le me know at [email protected]
    Thanks in Advance
    Alok

    Hi,
    Use explain plan to know if index is use.
    As you can see in the following example, even if index is composed and I use only a part in query, index can be used :
    SQL> create table test (col1 number, col2 number, col3 varchar2(10));
    Table created.
    SQL> insert into test select object_id, data_object_id, substr(object_name,1,10) from dba_objects;
    70211 rows created.
    SQL> create index idx on test(col1,col2);
    Index created.
    SQL> explain plan for
      2  select col1,col2,col3 from test where col1 > 500;
    Explained.
    SQL> @$ORACLE_HOME/rdbms/admin/utlxpls
    PLAN_TABLE_OUTPUT
    | Id  | Operation                   |  Name       | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT            |             |       |       |       |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEST        |       |       |       |
    |*  2 |   INDEX RANGE SCAN          | IDX         |       |       |       |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       2 - access("TEST"."COL1">500)
           filter("TEST"."COL1">500)
    Note: rule based optimization
    16 rows selected.
    --If stats are collected, index is no more used
    SQL> analyze table test compute statistics;
    SQL> explain plan for
      2  select col1,col2,col3 from test where col1 > 500;
    Explained.
    SQL> @$ORACLE_HOME/rdbms/admin/utlxpls
    PLAN_TABLE_OUTPUT
    | Id  | Operation            |  Name       | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT     |             | 69808 |  1227K|    16 |
    |*  1 |  TABLE ACCESS FULL   | TEST        | 69808 |  1227K|    16 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter("TEST"."COL1">500)
    Note: cpu costing is off
    14 rows selected.
    --But if you use an equlity in your query instead of >, index is still used
    SQL> explain plan for
      2  select col1,col2,col3 from test where col1 = 500;
    Explained.
    SQL> @$ORACLE_HOME/rdbms/admin/utlxpls
    PLAN_TABLE_OUTPUT
    | Id  | Operation                   |  Name       | Rows  | Bytes | Cost  |
    |   0 | SELECT STATEMENT            |             |     1 |    18 |     3 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| TEST        |     1 |    18 |     3 |
    |*  2 |   INDEX RANGE SCAN          | IDX         |     1 |       |     2 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       2 - access("TEST"."COL1"=500)
    Note: cpu costing is off
    15 rows selected.
    SQL> Nicolas.

  • Query Uses Index in 8i but not in 9i

    I have simple query which runs good in Oracle 8i. It uses index ,if i use = or in clause.
    Same query is not using Index in Oracle 9i,(We made the the optimizer as choose) . If i remove in clause and make it = ,it is using index
    select * from DWFE_ELE_CAT_ACC_HISTORY
    where udc_acct_num in (Select z.LAH_CURR_LDC_ACCT_NUM
    from DWFE_LDC_ACCT_HISTORY B,DWFE_LDC_ACCT_HISTORY z
    Where B.LAH_CURR_LDC_ACCT_NUM ='0382900397'
    and B.cpa_prem_num = Z.cpa_prem_num );

    Plan for Oracle 8i
    Execution Plan
    0 SELECT STATEMENT Optimizer=RULE
    1 0 NESTED LOOPS
    2 1 VIEW OF 'VW_NSO_1'
    3 2 REMOTE* RSSCP_DB
    LINK
    4 1 TABLE ACCESS (BY INDEX ROWID) OF 'CAT_TRANS_HISTORY'
    5 4 INDEX (RANGE SCAN) OF 'IDX3_CAT_TRANS_HISTORY' (NON-UN
    IQUE)
    3 SERIAL_FROM_REMOTE SELECT /*+ */ DISTINCT "A1"."LAH_CURR_LDC_AC
    CT_NUM" FROM "RSSC"."LDC_ACCT_HISTOR
    Statistics
    0 recursive calls
    0 db block gets
    8 consistent gets
    0 physical reads
    0 redo size
    7827 bytes sent via SQL*Net to client
    316 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    6 rows processed
    Plan for Oracle 9i
    Execution Plan
    0 SELECT STATEMENT Optimizer=CHOOSE (Cost=12018 Card=67728 Byt
    es=9752832)
    1 0 HASH JOIN (Cost=12018 Card=67728 Bytes=9752832)
    2 1 VIEW OF 'VW_NSO_1' (Cost=707 Card=17041 Bytes=238574)
    3 2 REMOTE* RSSCP_DB
    LINK
    4 1 TABLE ACCESS (FULL) OF 'CAT_TRANS_HISTORY' (Cost=6204 Ca
    rd=1905290 Bytes=247687700)
    3 SERIAL_FROM_REMOTE SELECT /*+ */ "A1"."LAH_CURR_LDC_ACCT_NUM" F
    ROM "RSSC"."LDC_ACCT_HISTORY" "A2","
    Statistics
    42 recursive calls
    1 db block gets
    41038 consistent gets
    41010 physical reads
    380 redo size
    7833 bytes sent via SQL*Net to client
    253 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    6 rows processed

  • Read selected values from a multi choice field programatically using Microsoft.SharePoint.Client namespace.

    All examples I found refer to classes under Microsoft.SharePoint namespace. However, I have the SharePoint CSOM that only gives me the Microsoft.Sharepoint.Client namespace.
    I need to read the selected values of a multichoice field, but not sure how to do it with classes in the namespace above.
    everthing works, exept the TSQL_x0020_Reference_x0020_Numbe field.
    my code looks like this:
    Webweb = cont.Web;
                cont.Load(web);
                cont.ExecuteQuery();
    Listsstest = web.Lists.GetByTitle("T-SQL
    Code Review Tracking");
    //CamlQuery query = CamlQuery.CreateAllItemsQuery();
    CamlQueryquery =
    newCamlQuery();
                query.ViewXml =
    @"<View>
                               <ViewFields>
                                    <FieldRef Name='Category'/>
                                    <FieldRef Name='Review_x0020_Type'/>
                                    <FieldRef Name='Review_x0020_Start_x0020_Date'/>
                                    <FieldRef Name='Title'/>
                                    <FieldRef Name='Location'/>
                                    <FieldRef Name='Project'/>
                                    <FieldRef Name='Author0'/>
                                    <FieldRef Name='AssignedTo'/>
                                    <FieldRef Name='TSQL_x0020_Reference_x0020_Numbe'/>
                                </ViewFields>
                             </View>"
     ListItemCollectionitems
    = sstest.GetItems(query);
                cont.Load(items);
                cont.ExecuteQuery();
    foreach(ListItemitem
    initems)
                    Output0Buffer.AddRow();
                    Output0Buffer.ReviewStatus = item.FieldValues[
    "Category"] !=
    null? item.FieldValues["Category"].ToString()
    : String.Empty;
                    Output0Buffer.ReviewType = item.FieldValues[
    "Review_x0020_Type"] !=
    null? item.FieldValues["Review_x0020_Type"].ToString()
    : String.Empty;
                    Output0Buffer.ReviewDate =
    DateTime.Parse(item.FieldValues["Review_x0020_Start_x0020_Date"].ToString());
                    Output0Buffer.Module = item.FieldValues[
    "Title"] !=
    null? item.FieldValues["Title"].ToString()
    : String.Empty;
                    Output0Buffer.BranchLocationURL = item.FieldValues[
    "Location"] !=
    null? item.FieldValues["Location"].ToString()
    : String.Empty;
                    Output0Buffer.ProjectName = item.FieldValues[
    "Project"] !=
    null? item.FieldValues["Project"].ToString()
    : String.Empty;
                    Output0Buffer.Author = item.FieldValues[
    "Author0"] !=
    null? item.FieldValues["Author0"].ToString()
    : String.Empty;
    FieldLookupValueflvAssignedTo =
    newFieldUserValue();
                    flvAssignedTo = item.FieldValues[
    "AssignedTo"]
    asFieldLookupValue;
    if(flvAssignedTo !=
    null)
                        Output0Buffer.AssignedTo = flvAssignedTo.LookupValue;
    varv = item.FieldValues["TSQL_x0020_Reference_x0020_Numbe"];
    if(v !=
    null)
                        Output0Buffer.Reason2 = v.ToString();
                 Output0Buffer.SetEndOfRowset();           

    Hi,
    According to your description, my understanding is that you want to read the selected choice field value using Client Object Model.
    In my environment, I create a list with a mutichoice fileld named "choice" and then I used the code snippet below to get the selected value in choice field.
    ClientContext clientContext = new ClientContext("http://sp2013sps/sites/test1");
    Microsoft.SharePoint.Client.List spList = clientContext.Web.Lists.GetByTitle("list1");
    clientContext.Load(spList);
    clientContext.ExecuteQuery();
    if (spList != null && spList.ItemCount > 0)
    Microsoft.SharePoint.Client.CamlQuery camlQuery = new CamlQuery();
    camlQuery.ViewXml =
    @"<View>
    <ViewFields><FieldRef Name='choice' /></ViewFields>
    </View>";
    ListItemCollection listItems = spList.GetItems(camlQuery);
    clientContext.Load(listItems);
    clientContext.ExecuteQuery();
    string value = listItems[0]["choice"].ToString();
    Console.WriteLine(value);
    Console.ReadKey();
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How does select stmt with for all entries uses Indexes

    Hello all,
    I goes through a number of documents but still confused how does select for all entries uses indexes if fields are not in sequences. i got pretty much the same results if i take like two cases on Hr tables HRP1000 and HRP1001(with for all entries based upon hrp1000). Here is the sequence of index fields on hrp1001 (MANDT, OTYPE, OBJID, PLVAR, RSIGN, RELAT, ISTAT, PRIOX, BEGDA, ENDDA, VARYF, SEQNR). in second case objid field is in sequence as in defined Index but i dont see significant increase in field even though the number of records are around 30000. My question is does it make a differrence to use field sequence (same as in table indexes) in comparison to redundant field sequence (not same as defined in table indexes), secondly how we can ge tto know if table index is used in Select for entries query i tried Explain in ST05 but its not clear if it uses any index at all in hrp1001 read.
    here is the sample code i use to get test results.
    test case 1
    REPORT  zdemo_perf_select.
    DATA: it_hrp1000 TYPE STANDARD TABLE OF hrp1000 WITH HEADER LINE.
    DATA: it_hrp1001 TYPE STANDARD TABLE OF hrp1001 WITH HEADER LINE.
    DATA: it_hrp1007 TYPE STANDARD TABLE OF hrp1007 WITH HEADER LINE.
    DATA: it_pa0000 TYPE STANDARD TABLE OF pa0000 WITH HEADER LINE.
    DATA: it_pa0001 TYPE STANDARD TABLE OF pa0001 WITH HEADER LINE.
    DATA: it_pa0002 TYPE STANDARD TABLE OF pa0002 WITH HEADER LINE.
    DATA: it_pa0105_10 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: it_pa0105_20 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: t1 TYPE timestampl,
          t2 TYPE timestampl,
          t3 TYPE timestampl 
    SELECT * FROM hrp1000 CLIENT SPECIFIED  INTO TABLE it_hrp1000 bypassing buffer
                WHERE mandt EQ sy-mandt AND
                      plvar EQ '01' AND
                      otype EQ 'S'AND
                      istat EQ '1' AND
                      begda <= sy-datum AND
                      endda >= sy-datum AND
                      langu EQ 'EN'.
    GET TIME STAMP FIELD t1.
    SELECT * FROM hrp1001 CLIENT SPECIFIED INTO TABLE it_hrp1001 bypassing buffer
                FOR ALL ENTRIES IN it_hrp1000
                 WHERE mandt EQ sy-mandt AND
                        otype EQ 'S' AND
    *                    objid EQ it_hrp1000-objid and
                        plvar EQ '01' AND
                        rsign EQ 'B' AND
                        relat EQ '007' AND
                        istat EQ '1' AND
                        begda LT sy-datum AND
                        endda GT sy-datum and
                        sclas EQ 'C' and
                        objid EQ it_hrp1000-objid.
    *                    %_hints mssqlnt 'INDEX(HRP1001~0)'.
    *delete it_hrp1001 where sclas ne 'C'.
    GET TIME STAMP FIELD t2.
    t3 = t1 - t2.
    WRITE: 'Time taken - ', t3.
    test case 2
    REPORT  zdemo_perf_select.
    DATA: it_hrp1000 TYPE STANDARD TABLE OF hrp1000 WITH HEADER LINE.
    DATA: it_hrp1001 TYPE STANDARD TABLE OF hrp1001 WITH HEADER LINE.
    DATA: it_hrp1007 TYPE STANDARD TABLE OF hrp1007 WITH HEADER LINE.
    DATA: it_pa0000 TYPE STANDARD TABLE OF pa0000 WITH HEADER LINE.
    DATA: it_pa0001 TYPE STANDARD TABLE OF pa0001 WITH HEADER LINE.
    DATA: it_pa0002 TYPE STANDARD TABLE OF pa0002 WITH HEADER LINE.
    DATA: it_pa0105_10 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: it_pa0105_20 TYPE STANDARD TABLE OF pa0105 WITH HEADER LINE.
    DATA: t1 TYPE timestampl,
          t2 TYPE timestampl,
          t3 TYPE timestampl 
    SELECT * FROM hrp1000 CLIENT SPECIFIED  INTO TABLE it_hrp1000 bypassing buffer
                WHERE mandt EQ sy-mandt AND
                      plvar EQ '01' AND
                      otype EQ 'S'AND
                      istat EQ '1' AND
                      begda <= sy-datum AND
                      endda >= sy-datum AND
                      langu EQ 'EN'.
    GET TIME STAMP FIELD t1.
    SELECT * FROM hrp1001 CLIENT SPECIFIED INTO TABLE it_hrp1001 bypassing buffer
                FOR ALL ENTRIES IN it_hrp1000
                 WHERE mandt EQ sy-mandt AND
                        otype EQ 'S' AND
                        objid EQ it_hrp1000-objid and
                        plvar EQ '01' AND
                        rsign EQ 'B' AND
                        relat EQ '007' AND
                        istat EQ '1' AND
                        begda LT sy-datum AND
                        endda GT sy-datum and
                        sclas EQ 'C'." and
    *                    objid EQ it_hrp1000-objid.
    *                    %_hints mssqlnt 'INDEX(HRP1001~0)'.
    *delete it_hrp1001 where sclas ne 'C'.
    GET TIME STAMP FIELD t2.
    t3 = t1 - t2.
    WRITE: 'Time taken - ', t3.

    Mani wrote:
    Thank you for your answer, its very helpful but i am still nor sure how does parameter rsdb/max_blocking_factor affect records size.
    Hi,
    The blocking affects the size of the statement and the memory structures for returning the result.
    So if your itab has 500 rows and your blocking is 5, the very same statement will be executed 100 times.
    Nothing good or bad about this so far.
    Assume, your average result for an inlist 5 statement is 25 records with an average size of 109 bytes.
    You average result size will be 2725 byte plus overhead which will nearly perfectly fit into two 1500 byte ethernet frames.
    Nothing to do in this case.
    Assume your average result for an inlist 5 statement is 7 records with an average size of 67 bytes.
    You average result size will be ~ 470 byte plus overhead which will only fill 1/3 of a 1500 byte ethernet frame.
    In this case, setting the blocking to 12 ... 15 will give you 66% network transfer performance gain,
    and reduces the number of calls to the DB by 50%, giving additional benefit.
    Now this is an extreme example. The longer the average row length is, the lower will be the average loss in the network.
    You have the same effects in memory structures, but on that layer you are fighting single micro seconds instead of
    hundreds of these, so in real life it is rarely measurable.
    Depending on table-statistics, oracle might decide for short inlists to use a concatanation instead of an inlist.
    This is supposed to be more costy, but I never had a case where I could proove a big difference.
    Values from 5 to 15 for blocking seem to be ok for me. If you have special statements in customer coding,
    it #might# be benefitial to do the mentioned calculations and do some network tracing to see if you can squeeze your
    network efficiency by tuning the blocking.
    If you have jumbo frames enabled, it might be worth to be analyzed as well.
    If you are only on a DB-CI system that is loopback connected to the DB, I doubt there might be a big outcome.
    Hope this helps
    Volker

  • Simple Select on VBPA using index running very slow

    Hello,
    We have a very simple selection on the table VBPA:
    data:
    begin of it_vbeln occurs 100,
      vbeln like vbpa-vbeln,
    end of it_vbeln.
    select vbeln from vbpa
    into table it_vbeln
    where
    kunnr = '##########'
    and parvw = 'AG'.
    All we're trying to accomplish is to find orders for a given customer number and type.
    We have two indices "Z1" and "Z2" which respectively declare: KUNNR, and MANDT, KUNNR, PARVW.
    In looking at a sql trace, it says it's using the VBPA~Z2 index, which is expected, and that its estimated costs are very low on the index:
    SELECT STATEMENT ( Estimated Costs = 71 , Estimated #Rows = 63 )
           2 TABLE ACCESS BY INDEX ROWID VBPA
             ( Estim. Costs = 71 , Estim. #Rows = 63 )
             Estim. CPU-Costs = 553,782 Estim. IO-Costs = 71
               1 INDEX RANGE SCAN VBPA~Z2
                 ( Estim. Costs = 3 , Estim. #Rows = 111 )
                 Search Columns: 3
                 Estim. CPU-Costs = 43,764 Estim. IO-Costs = 3
    Despite declaring that it will do an index range scan, in SM51 it shows as Sequential Read (Table Scan?) and takes a VERY long time to return, about 60 - 120 seconds.
    Since this is needed for a user exit that will be run during order creation, it needs to occur MUCH faster. Our entries in VBPA number above 10 million records currently.
    Can anyone suggest either why the index does not appear to be helping (it takes just as long without the index), or perhaps another method for finding the orders for a given customer number.
    Thank you,
    Randy

    Hi Randy,
    I suggest you skip the attempts to speed up selecting on VBPA, but rather look into using table VAKPA for finding sales documents for a given partner number.
    Greetings
    Thomas

  • 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" ?

  • If my phone service is disconnected, can I still use the number to iMessage? Under my setting in iMessages it only allows me to select my linked emails and the telephone number is there but grayed out and i can't seletect it !

    If my phone service is disconnected, can I still use the number to iMessage? Under my setting in iMessages it only allows me to select my linked emails and the telephone number is there but grayed out and i can't seletect it ! It wont activate. I just recentely got AT&T.  When I had verizon before and my phone got disconnected it allowed me to still iMessage off my number.

    If your phone service is disconnected, it's not your number any more.
    If you "just got AT&T", how can it be disconnected?

  • How can i use index in select query.. facing problem with the select query.

    Hi Friends,
    I am facing a serious problem in one of the select query. It is taking a lot of time to fetch data in Production Scenario.
    Here is the query:
      SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelat LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelatrprctr
        WHERE rldnr  = c_telstra_accounting
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          And rzzlstar in r_lstar                            
          AND rpmax  = c_max_period.
    There are 5 indices present for Table ZTFTELAT.
    Indices of ZTFTELAT:
      Name   Description                                               
      0        Primary key( RCLNT,RLDNR,RRCTY,RVERS,RYEAR,ROBJNR,SOBJNR,RTCUR,RUNIT,DRCRK,RPMAX)                                          
      005    Profit (RCLNT,RPRCTR)
      1        Ledger, company code, account (RLDNR,RBUKRS, RACCT)                                
      2        Ledger, company code, cost center (RLDNR, RBUKRS,RCNTR)                           
      3        Account, cost center (RACCT,RCNTR)                                        
      4        RCLNT/RLDNR/RRCTY/RVERS/RYEAR/RZZAUFNR                        
      Z01    Activity Type, Account (RZZLSTAR,RACCT)                                        
      Z02    RYEAR-RBUKRS- RZZZBER-RLDNR       
    Can anyone help me out why it is taking so much time and how we can reduce it ? and also tell me if I want to use index number 1 then how can I use?
    Thanks in advance.

    Hi Shiva,
    I am using two more select queries with the same manner ....
    here are the other two select query :
    ***************1************************
    SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelpt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelptrprctr
        WHERE rldnr  = c_telstra_projects
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar             
          AND rpmax  = c_max_period.
    and the second one is
    *************************2************************
      SELECT * APPENDING CORRESPONDING FIELDS OF TABLE tbl_summary
        FROM ztftelnt LEFT JOIN ztfzberep
         ON  ztfzberep~gjahr = st_input-gjahr
         AND ztfzberep~poper = st_input-poper
         AND ztfzberepcntr  = ztftelntrprctr
        WHERE rldnr  = c_telstra_networks
          AND rrcty  = c_actual
          AND rvers  = c_ver_001
          AND rbukrs = st_input-bukrs
          AND racct  = st_input-saknr
          AND ryear  = st_input-gjahr
          and rzzlstar in r_lstar                              
          AND rpmax  = c_max_period.
    for both the above table program is taking very less time .... although both the table used in above queries have similar amount of data. And i can not remove the APPENDING CORRESPONDING. because i have to append the data after fetching from the tables.  if i will not use it will delete all the data fetched earlier.
    Thanks on advanced......
    Sourabh

  • Index not being used in Select statement

    Friends
    I have the following SQL statement:
    SELECT
    a.acct,
    a.date_field,
    UPPER(b.feegroup) feegrp,
    SUM (a.fee1) fee1,
    SUM (a.fee2) fee2,
    SUM (a.fee3) fee3
    FROM table1 a, table2 b
    WHERE 1 = 1
    AND a.fee_id = b.fee_id
    GROUP BY a.acct, a.date_field, b.feegroup;
    Both the tables have index on fee_id column. When I run the explain plan for this statement, I am getting the following output:
    Operation | Option | Object Name | Position
    SELECT STATEMENT | | | 560299
    HASH | GROUP BY| |1
    TABLE ACCESS | FULL| table2 | 1
    TABLE ACCESS | FULL| table1 | 2
    Why Oracle is not using the index?
    Edited by: darshilm on Dec 10, 2009 3:56 PM

    The proposed plan is the optimal according to your current conditions in the "where clause" where you have only the equality join condition and therefore the CBO can use HASH JOIN. Using any kind of index access would just increase the amount of required work unless you would add some very restrictive conditions which will select rows from relatively small amount of blocks. Here I have to mention that what really counts in the CBO cost calculation is the amount of blocks accessed and not the number of rows. The "currency" for I/O in Oracle is a block and not a row. CBO always uses an assumption that there is nothing in the buffer cache and it will have to perform a physical read for every block.
    How many blocks will actually be accessed depends on the data distribution. It can happen that every single row that you have to retrieve resides in a different block and although you access only 1000 rows out of a million row table you would have to visit almost every block of that table. For such a situation a FULL TABLE SCAN is the best access path and Oracle will use multiblock I/O for that. On the other side you can have those 1000 rows only in a few blocks and then the index access would be the most appropriate one. For index access Oracle uses single block I/O. Usually the actual situation is somewhere between this two extreme situations. But you can run some tests by yourself and see when an index access will be replaced by a full table scan while you will make your predicates less selective.
    HTH, Joze
    Co-author of the forthcoming book "Expert Oracle Practices"
    http://www.apress.com/book/view/9781430226680
    Oracle related blog: http://joze-senegacnik.blogspot.com/
    Blog about flying: http://jsenegacnik.blogspot.com/
    Blog about Building Ovens, Baking and Cooking: http://senegacnik.blogspot.com

  • How to hide selection fields when using logical database PNP

    hi.
    i m using a logical database PNP and report catagory 1PY_DEF in my program.
    but when i execute it , it shows to selection box. one name is period and second is selections.
    but i just want to show only period box selection fields , not the selection box fields.
    how it iz possible.

    HI,
    In my case i haved used the PNP logical database..in the selection box i don't wnat to display Contorling area,Cost Center & Organizational Unit. i have written this code to hide those fields..
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name CS 'PNPKOKRS' OR
           screen-name CS 'PNPKOSTL' OR
           screen-name CS 'PNPORGEH'.
          screen-active = '0'.
          screen-invisible = '1'.
          MODIFY SCREEN.
          CLEAR screen.
        ENDIF.
      ENDLOOP.
    Try modify hide the total block instead of individual fields in that block.

Maybe you are looking for