How an INDEX of a Table got selected when a SELECT query hits the Database

Hi All,
How an Index got selected when a SELECT query hits the Database Table.
My SELECT query is as ahown below.
    SELECT ebeln ebelp matnr FROM ekpo
                   APPENDING TABLE i_ebeln
                   FOR ALL ENTRIES IN i_mara_01
                   WHERE werks = p_werks      AND
                         matnr = i_mara_01-matnr AND
                         bstyp EQ 'F'         AND
                         loekz IN (' ' , 'S') AND
                         elikz = ' '          AND
                         ebeln IN s_ebeln     AND
                         pstyp IN ('0' , '3') AND
                         knttp = ' '          AND
                         ko_prctr IN r_prctr  AND
                         retpo = ''.
The fields in the INDEX of the Table EKPO should be in the same sequence as in the WHERE clasuse?
Regards,
Viji

Hi,
You minimize the size of the result set by using the WHERE and HAVING clauses. To increase the efficiency of these clauses, you should formulate them to fit with the database table indexes.
Database Indexes
Indexes speed up data selection from the database. They consist of selected fields of a table, of which a copy is then made in sorted order. If you specify the index fields correctly in a condition in the WHERE or HAVING clause, the system only searches part of the index (index range scan).
The primary index is always created automatically in the R/3 System. It consists of the primary key fields of the database table. This means that for each combination of fields in the index, there is a maximum of one line in the table. This kind of index is also known as UNIQUE. If you cannot use the primary index to determine the result set because, for example, none of the primary index fields occur in the WHERE or HAVING clause, the system searches through the entire table (full table scan). For this case, you can create secondary indexes, which can restrict the number of table entries searched to form the result set.
reference : help.sap.com
thanx.

Similar Messages

  • How to view data in tables by selecting the synonym from the database objec

    I could not figure out how to view data in tables by selecting the synonym from the database objects navigation tree. I had to first choose the synonym, view the details of the synonym to determine the table name, and then select the table from the database objects tree. Is this the only way available?

    This functionality currently does not exist. I don't see it on the 1.1 statement of direction either, so perhaps someone from Oracle can give some insight as to when this could be expected.
    Eric

  • Check Index used in an oracle select query

    Hi Friends,
    I have partitioned an oracle table and created Local Index for the Partitioned table .
    Now i want to make sure that the Local index is being used when i perform select query on the Table partition.
    How do i confirm that ?
    can i check the explain plan generted for the select query to confirm local index is being used ?
    Please let me know.
    Regards,
    DB

    Now i want to make sure that the Local index is being used when i perform select query on the Table partition.Why? Have you proven that using this local index is the "best" plan?
    How do i confirm that ?
    can i check the explain plan generted for the select query to confirm local index is being used ?When I asked Google "how to read an oracle explain plan," I found lots of information - what did you find?

  • How can i use SUM aggregate in select query?

    HI,
    GURUS,
    How can i use SUM function in Select Query and i want to store that value into itab.
    for ex:
    TABLES: vbap.
    types: begin of ty_vbap,
           incluse type vbap,
           sum type string,
          end of ty_vbap.
    data: i_vbap type TABLE OF ty_vbap,
          w_vbap type ty_vbap.
    SELECT sum(posnr) FROM vbap into table i_vbap up to 5 rows.
                            (or)
    SELECT sum(posnr) FROM vbap into table i_vbap group by vbeln.
      loop at i_vbap into w_vbap
    " which variable have to use to display summed value.
      endloop.
    if above code is not understandable pleas give ome sample code on  above query.
    Thank u,
    shabeer ahmed.

    Hi,
    Check this sample code.
    TABLES SBOOK.
    DATA:  COUNT TYPE I, SUM TYPE P DECIMALS 2, AVG TYPE F.
    DATA:  CONNID LIKE SBOOK-CONNID.
    SELECT CONNID COUNT( * ) SUM( LUGGWEIGHT ) AVG( LUGGWEIGHT )
           INTO (CONNID, COUNT, SUM, AVG)
           FROM SBOOK
           WHERE
             CARRID   = 'LH '      AND
             FLDATE   = '19950228'
           GROUP BY CONNID.
      WRITE: / CONNID, COUNT, SUM, AVG.
    ENDSELECT.
    Regards,
    Sravanthi

  • How to use X-Fi Effects without selecting SB as the default sound device?

    How to use X-Fi Effects without selecting SB as the default sound device?Hello everyone,
    That's my situation.
    I have Sound Blaster X-Fi Go sound card and I am using SRS HD Audio Lab. SRS HD Audio Lab was selected as the default audio device and X-Fi effects (X-Fi CMSS-3d, Equalizer etc.) was working without any problem in Windows Xp. I have Windows 7 now and when i select SRS HD Audio Lab as the default device, Creative effects are not working, i must select "SB X-Fi Go!" to get them working but i can't use SRS HD Audio Lab in that case. SRS is also using SB X-Fi Go sound card as the output and volume adjustment on console launcher is working but something is disabling the effects. Any solutions to enable effects ?
    Thanks.

    If the kernel modules for your sound card and webcam both support the index parameter (use modinfo to find out) then adding
    options <name_of_preferred_card's_kernel_module> index=0
    options <name_of_second_card's_kernel_module> index=1
    to /etc/modprobe.d/modprobe.conf (or another modprobe conf file of your choice) should solve the problem.

  • How to pass a default value in selection screen of logical database pnpce

    Dear All,
    Can any one tell me how to pass a default value in selection screen of logical database pnpce .
    Regards
    Rakesh Singh

    Hi Rakesh,
    Go to SE36 (logical database Builder).First enter PNPCE in Logical Database and press documentation,here you will get the details of exactly what is PNPCE and how it works.After that select selections in subojects in se36 only and enter display ,there you have the include from where you acn get the idea.
    Regards,
    Rahul

  • TS1292 i got an itune card after I hit the pin in it show invalid number, so how to make it work?

    I got an itune card after I hit the pin in, it show invalid number so how to make it work?

    See Here  >  iTunes Store: Invalid, inactive, or illegible codes
    http://support.apple.com/kb/TS1292

  • How do I stop my cursor from selecting things on the page? It shows up like I want to type something and when I press the down key it goes through all the words like its a word document.

    How do I stop my cursor from selecting things on the page? It shows up like I want to type something and when I press the down key it goes through all the words like its a word document.
    == This happened ==
    Every time Firefox opened
    == June 27, 2010

    You have '''caret browsing''' enabled - that preference appears as set in your Troubleshooting Information.
    http://kb.mozillazine.org/Accessibility.browsewithcaret
    Hit the '''F7''' key to disable '''''caret browsing'''''.

  • How to create a DB Adapter with select query having inner query

    Hi All,
    I am trying to create a DB Adapter with select query. The query has some inner queries in it. It is just like this select a, b, c, (select d from e) d, (select e from e) e from tablename.
    The problem here is with the xsd generated for this query. Xsd is not getting generated properly for all the fields it is just getting generated till c element and when it encounters
    the inner query it is stopping the generation of xsd. So for the above query the xsd is something similar to the below
    <xs:complexType name="rewOutput">
    <xs:sequence>
    <xs:element name="a" type="xs:string" nillable="true"/>
    <xs:element name="b" type="xs:string" nillable="true"/>
    <xs:element name="c" type="xs:string" nillable="true"/>
    <xs:element name="select_d" type="xs:string" nillable="true"/>
    </xs:sequence>
    </xs:complexType>
    as shown above the xsd is just getting generated till the first inner query. What should be done to get the full fledged xsd. Should it be manually built ?? Please help me on this.
    Thanks In Advance.
    Edited by: 959766 on Nov 30, 2012 1:20 AM

    Hi,
    I don't think the parser will be able to understand your query properly... I would try building the xsd manually...
    Cheers,
    Vlad

  • How to write selection Query for the following requirment.

    Hi All,
    I am new to ABAP, I need a help ,
    I need to select all plants(WERKS) from MARC at Plant/Material level,
    then I need to take all sales organozation(VKORG) from T001w,
    then I need the company code(BUKRS) from TVKO based on VKORG,
    then I need the currency key(WAERS) from T001 based on BUKRS,
    Can any one help me in writing selection Query for the same?
    Thanks All,
    Debrup.

    Hi,
    Its easy for you if you learn SELECT with JOIN to complete your task. So SEARCH the forum with SELECT statement and you will get a lot of examples using which you can write your own.
    If you struck up anywhere revert back.
    Regards
    Karthik D

  • Select query on two Database views

    Hi all,
    Can i fetch the data by writing a select query on two DATABASE VIEWS
    Because i am able to fetch data by writing a selct query on ONE DATABASE VIEW and ON TRANSPARANT TABLE
    but i am not able to fetch data by writing a query on TWO DATABASE VIEWS
    Query which i am able to fetch data is
    select * from CSKS where OBJNR = COVJ-OBJNR
    Query which i am NOT able to fetch data is
    Select * from COAS where OBJNR = COVJ-OBJNR
    Here
    COVJ is a DATABASE VIEW
    CSKS is a Transparant Table
    COAS is a DATABASE VIEW
    Thanks in advance
    Regards
    Ajay

    Hi
    I tried with code and I am able to fetch data from view COAS
    DATA:it_coas TYPE STANDARD TABLE OF coas.
    SELECT * FROM coas INTO TABLE it_coas.
    IF sy-subrc IS INITIAL.
      WRITE:/ 'Sucess'.
    ENDIF.
    I think in your case COAS view does not have a value for COVJ-OBJNR.
    Regards
    Srilaxmi

  • How do I delete a row in Microsoft Access from a vi using the database toolkit

    Using the database toolkit 1.01 how can I delete a row from my vi

    Bambi,
    I know you already got the answer from Jeremy in the LabVIEW Forum, but I wanted to place this link here so that other users could see the answer.
    How do I delete a row in Microsoft Access from a vi using the database toolkit
    Evan

  • Tell me select Query that HITs the database Directly  ???

    Hi,
        I have a table, for this table in the Techinical Setttings I selected Buffering allowed, and buffering type is Full Bufferd.Now, I want a Select Query which hits the database directly, without fetching records from the BUFFER.
    Except using SELECT BYPASSING BUFFER query ????
        Regards,
    V.Raghavender.

    hi,
    ·        Any SELECT with a sub query or with joins
    ·        Any set function (COUNT, MIN, MAX, SUM, AVG)
    ·        GROUP BY
    ·        HAVING
    ·        SELECT DISTINCT
    ·        ORDER BY
    Examples:
    SELECT /*@ SAP BYPASSING BUFFER */ * FROM MYTAB
        WHERE KEY1 = ? AND KEY2 = ?
    SELECT * FROM MYTAB WHERE KEY1 = ?
    SELECT * FROM MYTAB
        WHERE KEY1 = ? AND KEY2 = ? OR KEY1 = ?
    SELECT MAX(DATA) FROM MYTAB WHERE KEY1 = ? KEY2 = ?
    SELECT * FROM MYTAB
        WHERE KEY1 = ? AND KEY2 = ? AND DATA =
       (SELECT DATA FROM MYTAB WHERE KEY1 = ? AND KEY2 = ?)
    if helpful pls award points.
    sri

  • SELECT query from multiple databases

    Hi,
    Is it possible to run a SELECT query using multiple DBs' tables, like outer joining them. One of the DBs is Sybase.
    Thanks in advance

    A TopLink session can span multiple databases if they can be accessed through a single connection. A single select would require the database to handle the aggregation as mentioned in the other post.
    Alternatively TopLink's session broker will support making a single session present persistent types from multiple independent databases. This approach will not support a single SELECT spanning the databases though.
    Doug

  • How to I get on to page 2 when my document stops at the page 1 layout line and won't go on to another page?

    How to I get on to page 2 when my document stops at the page 1 layout line and won't go on to another page?

    Sounds like you are using a Layout template. These you have to manually link from textbox to textbox.
    Try using a Word Processing template, it lists them in the sidebar of the Template Chooser.
    Peter

Maybe you are looking for

  • Second Time Capsule as external HD

    I just upgraded my Time Capsule and my computers are all backing up to the new Capsule.  Is it possible to connect the old Time Capsule to one of my computers with a USB connection and use the old one as an external HD? Will it back up to the new TC

  • AC-50480: Internal error occurred: java.lang.Exception: Error while generat

    Hi there I am moving db tier on another server with the clone utility. post clone on db tier were successful but on apps tier i am getting following error in adconfig.log file AC-50480: Internal error occurred: java.lang.Exception: Error while genera

  • Tiff support

    I have had no luck bringing in scanned photos saved in tiff format to iPhoto on my iPad. I use the application file sharing utility in iTunes to load them. Even when brought in at <19 MP iPhoto just doesn't see them. Unfortunately, this is the only l

  • Possible to save files in My Documents using JavaScript?

    I have a customer who wants his users (service technicians) to be prompted to save a PDF form they fill out, print, and sign for their customers. It's easy to set the File>Save As action for the form button, but my customer wants to know if it's poss

  • Display Graph in Smartform

    Hi all, I am have a requirement in smartform. I have to Display the Graph as my output. If any one worked on this please help me out. Thanks in advance. Ranjit