Performance Tuning "Select All" vs "Select Then Delete"

Dear Experts,
Please tell me which one has better prefromance between
SELECT a~vbeln
         a~kunnr
         a~bukrs_vf
         a~vkorg
         a~vtweg
         a~spart
         a~augru
         a~vbtyp
         a~auart
         a~bstnk
         b~kunnr
  INTO TABLE ivbak
  FROM vbak AS a
  INNER JOIN vbpa AS b
    ON  bvbeln EQ avbeln
    AND b~parvw EQ c_shipto
  WHERE a~kunnr IN s_kunnr AND
        a~vkorg EQ p_vkorg AND
        a~vtweg IN s_vtweg AND
        a~spart IN s_spart and
        a~auart in s_auart .
  DELETE ivbak WHERE NOT (
        vbeln IN s_vbeln  AND
        augru EQ space    AND
        vbtyp EQ s_order AND
        kunno IN s_kunev ).
  DELETE ivbak WHERE auart EQ ordertype2
                   OR auart EQ ordertype1.
  DELETE ADJACENT DUPLICATES FROM ivbak COMPARING ALL FIELDS.
AND
SELECT a~vbeln
         a~kunnr
         a~bukrs_vf
         a~vkorg
         a~vtweg
         a~spart
         a~augru
         a~vbtyp
         a~auart
         a~bstnk
         b~kunnr
  INTO TABLE i_vbak
  FROM vbak AS a
  INNER JOIN vbpa AS b
    ON  bvbeln EQ avbeln
    AND b~parvw EQ c_shipto
  WHERE a~kunnr IN s_kunnr AND
        a~vkorg EQ p_vkorg AND
        a~vtweg IN s_vtweg AND
        a~spart IN s_spart AND
        a~auart in s_auart AND
        a~vbeln NOT IN s_vbeln AND
        a~augru NE SPACE AND
        a~vbtyp NE s_order OR
        (auart EQ ordertype2
                   OR auart EQ ordertype1)

as a general recommendation, I would say that the second one should be faster.
But every rule has exceptions and your case could be such an exception. You really have to try booth version is a small test programm,
execute them with GET RUNTIME FIELD start and stop.
And check the SQL Trace. It can happen that version gets a different access path with different indexes. This can take much longer than the delete.
Siegfried

Similar Messages

  • How do you select all when trying to delete mail messages

    How can I select "all" email messages to delete them?  I know with PC you can push control + a, how do you do it on a MAC?

    Instead of Control A on any Mac it's Command A. For a list of keyboard shortcuts please click Keyboard Shortcuts

  • Is there any way to select all mail messages and delete them?

    I get lots of mail, and most of it I don't keep, or keep over on my MacBook. Is there a way to select all the Mail messages and delete them, or do I need to go through them one at a time?
    many thanks!
    Jeannette
    <Edited by Host>

    In your inbox in the phone you can mark the mails one by one and then tab delete.
    In Trash you can delete all with one tab.

  • How can I delete a file? At the moment I delete each pic and it takes ages! I tried select all and managed to delete all my 2300 photos!!  I've got them back but I've also got back 980 which I had already deleted 1 by 1 over the past 6 months!  Help!

    Please help! How can I delete a file without deleting all my photos?  I have just managed to delete all my more than 2000 photographs by choosing' Select all' and then delete. But I thought only 'all' the photographs in the file I had open would be selected! I have got them back, but I've also got back more than 800 others that I'd deleted SINGLY over the last 6 months! HELP!

    Put a Photo in the iPhoto Trash.
    iPhoto Menu -> Empty Trash
    This removes the photo from iPhoto and the Hard Disk (in every version of iPhoto except iPhoto11)
    In iPhoto 11 the file goes to the System Trash, you need to empty that too.
    Regards
    TD

  • I sometimes have over 1000 junk emails clogging my phone.  I would like to know if there is a way to 'select all' in order to delete them.  Deleting emails often takes me ungodly time.

    Please let me know if there is a way to select all emails and delete them.  Selecting, scrolling, selecting and scrolling is tedious when you have 1000-2000 junk emails to wade through.

    At the top of this page, click your name, where yours says "Welcome, linda166":
    Click the link "Manage email notifications":
    Click the checkbox at the upper right - to the right of where it says "Date" - this selects all of the messages on the page:
    Click the button "Remove selected notifications":
    Click "Next" and repeat for each page. You may have less than 213 pages.

  • How to get Select All or select Multiple columns  in OOALV

    HI Experts
    i'm assignig internal table to dynamic internal table(FS_IST_TABLE) for to display the output.
    but i'm not geting the Select ALL Option. and i can't select multiple columns at a time.
    where i can select only one column.
    how can i select multiple columns.
    please any one help me.
    regrads,
    rathan.

    Hi,
      If we want to select the multiple columns in the alv by using ooabap
    so in the class CL_GUI_ALV_GRID  it is having one method SET_TABLE_FOR_FIRST_DISPLAY
    it is having one importing parameter IS_LAYOUT of type lvc_s_layo type
    and this structure contains one field SEL_MODE and set that field value as 'A'.
    then we can select the multiple rows in alv grid

  • Select All only selects the body or header, not both, in Mail

    I'm nearly certain that in Mail under 10.4, with the cursor or a selection made in an incoming mail message body, Select All selected both the body and the header, which I use a lot for copying and pasting into other apps. In 10.5, only the body text is selected. Doesn't matter if the message is viewed in the view pane, or popped open. I don't see anything in prefs to change the behavior. Is it possible to have the header selected along with the body text without viewing the message with Long Headers chosen?
    Bob

    Not directly, but you can do what you want this way: click on "Forward" and a new email will come up with both the headers and the text of the message, so you can copy from there and then just close the forwarding email without sending or saving.
    If you don't want the message indented, turn off the "indent" and "increase indent" checkboxes in Mail>Preferences>Composing

  • Performance Tuning 'Runtime Error' on Select statement

    Hi Experts,
    Good Day!
    I would like to ask some help regarding a custom program that will encounter 'Runtime Error' on the below codes on how to perform performance tunning especially number 1.
    1.
    SELECT A~VBELN A~ERDAT A~AUART A~VKORG A~VTWEG A~SPART A~VDATU
             A~KUNNR B~POSNR B~MATNR B~ARKTX B~ABGRU B~KWMENG B~VRKME
             B~WERKS B~VSTEL B~ROUTE
          FROM VBAK AS A INNER JOIN VBAP AS B ON A~VBELN EQ B~VBELN
                         INNER JOIN VBEP AS C ON A~VBELN EQ C~VBELN
                           AND B~POSNR EQ C~POSNR
            INTO CORRESPONDING FIELDS OF TABLE I_DATA_TAB
              WHERE A~VBELN  IN S_VBELN
                AND A~VKORG  IN S_VKORG
                AND A~AUART  IN S_AUART
                AND A~VTWEG  IN S_VTWEG
                AND A~SPART  IN S_SPART
                AND A~VDATU  IN S_VDATU
                AND A~KUNNR  IN S_KUNNRD
                AND B~MATNR  IN S_MATNR
                AND B~KWMENG IN S_KWMENG
                AND B~VRKME  IN S_VRKME
                AND B~WERKS  IN S_WERKS
                AND C~EDATU  IN S_VDATU.
    2.
    SELECT VBELN FROM LIKP INTO LIKP-VBELN
                  WHERE LFDAT IN S_VDATU
                    AND VKORG IN S_VKORG
                    AND LFART EQ 'YSTD'
                    AND KUNNR IN S_KUNNRP
                    AND KUNAG IN S_KUNNRD
        SELECT VBELN POSNR LFIMG MATNR WERKS
           FROM LIPS INTO (LIPS-VBELN, LIPS-POSNR, DISPLAY_TAB-DEL_QTY,
                           LIPS-MATNR, LIPS-WERKS)
                 WHERE VBELN EQ LIKP-VBELN
                   AND MATNR IN S_MATNR
                   AND VTWEG IN S_VTWEG
                   AND SPART IN S_SPART
                   AND WERKS IN S_WERKS.   
         ENDSELECT.
      ENDSELECT.
    4.
    SELECT DELIVERY POSNR MATNR PODLFIMG FROM T9YPODI INTO
        (T9YPODI-DELIVERY, T9YPODI-POSNR, T9YPODI-MATNR, T9YPODI-PODLFIMG)
                           WHERE MATNR   IN S_MATNR
                             AND PODDATE IN S_VDATU.
    Answer's will be a great help.
    ~Thank You,
      Lourd
    Edited by: Lourd06 on Oct 23, 2009 10:32 AM
    Moderator message - Welcome to SCN.
    Moderator message - Please see Please Read before Posting in the Performance and Tuning Forum before posting. You're in the driver's seat here. It's up to you to do some analysis before expecting that people can halp you. - post locked
    And please use code tags.
    Edited by: Rob Burbank on Oct 23, 2009 9:13 AM

    Hi All,
    We've checked the transaction ST22 it is TIME OUT. I really need your help on this the program will dump in number 1 Select statement. Can you help me perform a performance tunning.
    In transaction ST22
    Runtime Errors         TIME_OUT
    Date and Time          21.10.2009 08:51:33
    Short text
         Time limit exceeded.
    What happened?
         The program "ZV0PSR10" has exceeded the maximum permitted runtime without
         interruption and has therefore been terminated.
    What can you do?
         Note down which actions and inputs caused the error.
         To process the problem further, contact you SAP system
         administrator.
         Using Transaction ST22 for ABAP Dump Analysis, you can look
         at and manage termination messages, and you can also
         keep them for a long time.
    Error analysis
         After a specific time, the program is terminated to make the work area
         available to other users who may be waiting.
         This is to prevent a work area being blocked unnecessarily long by, for
         example:
         - Endless loops (DO, WHILE, ...),
         - Database accesses with a large result set
         - Database accesses without a suitable index (full table scan)
         The maximum runtime of a program is limited by the system profile
         parameter "rdisp/max_wprun_time". The current setting is 1200 seconds. If this
          time limit is
         exceeded, the system attempts to cancel any running SQL statement or
         signals the ABAP processor to stop the running program. Then the system
         waits another 60 seconds maximum. If the program is then still active,
         the work process is restarted.
    ~Thank you
    Lourd
    Edited by: Lourd06 on Oct 23, 2009 11:22 AM
    Edited by: Lourd06 on Oct 23, 2009 11:33 AM

  • Apple script to select all, joint tracks, then Import CD

    Anyone know of a script that will do that?
    Thanks
    Alfredo

    Have you tried looking at Doug's Scripts? www.dougscripts.com

  • Thread-safe and performant way to return rows and then delete them

    Hi all
    I have a table containing rows to be processed by Java. These rows need to be returned to Java, then they willl be processed and sent to a JMS queue, then if that JMS operation is successful they need to be deleted from the Oracle table..
    The current method is:
    Java calls Oracle SP with 'numrows' parameter.
    Oracle SP updates that number of rows in the table with a batch ID from a sequence, and commits.
    Oracle SP returns the Batch_ID to Java.
    Java then selects * from table where batch_id = XXXX;
    Java sends messages to JMS. If JMS transaction is OK, Java deletes from table where batch_Id =xxxx and commits;
    Clearly this isn't very efficient. What I would like to do is this:
    Java calls Oracle SP with 'numrows' parameter
    Oracle SP returns that many rows in a cursor and deletes them from the table simultaneously. Oracle SP does not open a new transaction - transaction is controlled from JAva.
    Java writes to JMS. If JMS is OK, Java commits its DB transaction and thus the rows are deleted.
    Therefore there's only a single DML operation - a DELETE.
    The trouble is, this is not threadsafe - if I have two Java threads calling the Oracle SP, then thread #2 may return rows that thread #1 already got - because thread#1 has not yet committed its delete, and thread#2 can select those rows. Thread#2 will then lock waiting to delete them until thread#1 has finished its delete, then thread#2 will get "0 rows deleted". But Java will stlil have been sent those rows.
    How can I engineer this method to be as efficient as possible while still being threadsafe? The key problem I'm having is that the DELETE operation doesn't prevent the rows being SELECTed by other threads - if there was a way to DELETE without committing but also immediately make those rows unavailable to other threads, that would work I think.
    Any help much appreciated
    Tom

    Hi Tom,
    You forgot to "mention" your version.
    I'm not sure, but I believe [SKIP LOCKED|http://download.oracle.com/docs/cd/E11882_01/server.112/e10592/statements_10002.htm#SQLRF01702] is safe to use. At least in 11.1. (I have used in both 9i and 10g where it was unsupported/undocumented)
    There is of course always the boring way: A single thread.
    Regards
    Peter

  • 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

  • Select All in large table

    My product has some very large tables (using RANGE_PAGING). I want to allow the end user to do a Select All operation, and then press a command button to act on all selected rows, but want my backing code to detect a Select All has been done, rather than attempt to retrieve all rows from the table. Is this doable with a RichTable?
    I'm porting an existing UI over to ADF -- the old UI handled this by having a separate select all button (column header), which would get unset if any row got unselected, and the backing code could interrogate that. I was wondering if there was a more ADF-ish way of handling this.
    Using Oracle JDeveloper 11g Release 1 (11.1.1.6.0)
    Edited by: user12614476 on Dec 5, 2011 1:58 PM
    (added JDeveloper version info)

    Are you really using 11.1.1.6? If so, I guess you should be asking in one of the internal Oracle forums.
    But, no, there's no "more ADF-ish" way to my knowledge :)
    John

  • How to code for select all& deselect all?using menu buttons

    hai,
    i have generated a report with a single field from a database table and
    i have a checkbox for each record/item in the report.
    i need help in the following ..
    now that i have menu buttons say "select all" and "deselect all"..
    if select all is clicked then all checkboxes should be selected.
    if deselect all is clicked, then all checkboxes should be deselected
    i know that we have to use functional code and use case sy-ucomm etc.
    when "selectall"  etc..
    can someone help me how to code for this to work exactly?

    it did not work for the code u had suggested...
    plz check it out and send me the exact working code..
    REPORT  ZINTRACTIVE_PROJ                        .
    TABLES : SFLIGHT.
    DATA : BEGIN OF IT OCCURS 0,
           CARRID LIKE SFLIGHT-CARRID, FLDATE LIKE SFLIGHT-FLDATE,
           END OF IT.
    DATA : BOX TYPE C,
           LINE TYPE I.
    SELECT CARRID FLDATE FROM SFLIGHT INTO TABLE IT.
    LOOP AT IT.
    WRITE : / BOX AS CHECKBOX, IT-CARRID.
    ENDLOOP.
    LINE = SY-LINNO .
    SET PF-STATUS 'SELECT'.
    AT USER-COMMAND.
    CASE SY-UCOMM.
      WHEN 'SELECT'.
          DO LINE TIMES.
            READ LINE SY-INDEX FIELD VALUE BOX.
            IF BOX = 'X'.
               NEW-PAGE.
               WRITE : / IT-FLDATE.
            ENDIF.
          ENDDO.
      <b>WHEN 'SELECTALL'.
          LOOP AT IT.
            IT-CARRID = 'X'.
            MODIFY IT TRANSPORTING CARRID WHERE CARRID = IT-CARRID.
            EXIT.
          ENDLOOP.
      WHEN 'DESELECTALL'.
          LOOP AT IT.
            IT-CARRID = ''.
            MODIFY IT TRANSPORTING CARRID WHERE CARRID = 'X'.
            EXIT.
          ENDLOOP.</b>ENDCASE.

  • BUG: Disabling 'Select All | Select None' for af:tableSelectMany

    I have a simple af:table that incorporates an af:tableSelectMany. Within the af:tableSelectMany I have the disabled property bound to my view's backing bean like this disabled="#{myBackingBean.selectManyDisabled}". The backing bean then returns true or false based on whether the user should be able to change the selection in the table.
    When the disabled property is set to true, the table's "select" column is displayed appropriately. The checkboxes are grayed out and the user cannot change their state by clicking on them. However, the Select All and Select None links are still shown at the top of the table and still are active. Clicking one of these links changes the selection state for this items in the table. Shouldn't these links be disabled too? Has anyone else found a reasonable solution to this bug?
    Thanks,
    Jim

    Unfortunately that does not fit my usecase.
    The Select column always needs to be shown because the selection state of an entry in the table represents that entry's inclusion or exclusion within a higher level object. It is important to show the user this information. There are just some cases when we do not want to allow the user to change this information. (Specifically when showing historical data).
    I did consider not rendering the af:tableSelectMany as shown in that sample, but then I would have to build my own "Select" column that would be rendered whenerever the af:tableSelectMany was not rendered. In my own column I would have to place disabled check boxes to mimic the display.
    At this point I have developed a work-around solution. In the af:table that contains this af:tableSelectMany component I have the selectionState property bound to my backing bean as well as having the selectionListener bound. When I receive the SelectionEvent notification, I rebuild the selectionState RowKeySet to remove any effect of the Select All or Select None. The result is that the check boxes simply "blink" but always remain as they should be. It's a hack, but it works.
    It would be much better if the Select All and Select None links were not displayed or were disabled. I really feel this is a bug since disabling the af:tableSelectMany does properly draw the checkboxes in a disabled state. They just forgot to deal with the two links.
    Jim

  • Selecting all unread emails

    Hi all,
    I was curious how I could quickly select all unread messages. I hate having to click each one to mark them as read. Is there a way to select all unread. Then mark as read?

    Try this: 
    1. Go to the account
    2. Select the inbox.
    3. Tap edit &amp; select any email
    4. Hold down the button
    5. While holding the Mark All button, deselect the email
    6. Release the Mark All button
    7. Press the Mark All button again. 
    Done

Maybe you are looking for

  • How can i deactivate the automatic downloads of my media in the itunes store

    I just activated the automatic download on my imac, thinking just about music. No, my i mac started to download all movies, i have downloaded on my i-tv, which I don`t want. I so far failed to find a point in the menues to deactivate that automatic d

  • How do I use a JDBC Resource set-up in Sun Java System Appliation Server?

    How do I use a JDBC Resource set-up in Sun Java System Appliation Server 8.2? I created a JDBC Resource labeled "jdbc/__PetroPool" that is backed by a Connection Pool labeled "PetroPool". Since this is set-up in Sun Java System Appliation Server 8.2,

  • Email addresses & app world

    Hello everyone!  I have just bought myself the Curve 9300 and given my old bb (8520) to a friend. He's just tried to access bb app world but it came up with my email address and required my password. He said he attempted to put another email address

  • Adpreclone.pl Non-interactive Mode

    Hi All, want to automate backup of APPL tier To do that it is required to run adpreclone.pl with non-interactive mode i.e. It will not ask for any password when it will run through shell script. Or something like perl adpreclone.pl appsTier pwd=<> Is

  • Upgrading mac pro video card questions

    I want to upgrade my video card, I currently have a 7300 gt, and my mac pro is a 2007. Will any video card that uses the same type of pci slot work or does the card have to be specially made for macs. Also what would be the best upgrade for my mac, i