Question about Performance Operators

Hello friends...
I have a doubt, can anyone help me?
whats the bes operator for good performance ?
select...
from...
where ID IN (a,b)
or
select...
from...
where ID =a or id=b
Tks

In terms of how Oracle uses them, they are they are essentially the same. With an explicit list like your example, Oracle will generally internally re-write the IN to a series of ORs.
I would use IN in almost all cases since it is more readable and easier to get right if you have other predicates. For example:
SQL> SELECT * FROM t;
        ID DESCR
         1 One
         1 Un
         2 One
         2 Deux
         3 One
SQL> SELECT * FROM t
  2  WHERE id in (1, 2) and
  3        descr = 'One';
        ID DESCR
         1 One
         2 One
SQL> SELECT * FROM t
  2  WHERE id = 1 or
  3        id = 2 and
  4        descr = 'One';
        ID DESCR
         1 One
         1 Un
         2 One
SQL> SELECT * FROM t
  2  WHERE (id = 1 or
  3         id = 2) and
  4        descr = 'One';
        ID DESCR
         1 One
         2 OneJohn

Similar Messages

  • A simple question about performance!

    Hi! I have a simple question about performance. Suppouse that you have a servlet or a class with DB access, and you need to use a value several times in that page. What is best, to assign the value from say, a resultset or a request.getParameter() to a variable or to call the resultset or the request every time you need to retrieve that value? Which option uses less memory, which is faster, etc.?
    Hoping the best fou u
    Raul

    If you need more values from a db, the best is to open some connections (connection pool) and use the for accessing the db.
    To get the data only once, open the connection, get the data, store the data whereever you want: variable (class), hidden control (if you want to send from one page to another by request) and close the connection as quicky as possible.
    The advantage of the first method is that the most time consuming activity (connections opening) is done only once.

  • A question about Performance Settings

             Dear all.
                           Hi all,I want add a performance poller about Environmental Temperature.
                            There is an error as shown in the figur:
                            The device is Nexus 7010.  Is it support  this poller ?
                              If support,how to setting ?
                             Thank you very much

    Peanuts
     Thank you for your time and help.
    Dumb question  Reflash the firm ware
    Means Install the new firm ware list on this web site
    my old is v3.0.02 build 003 june 4, 2009
    The new one is v3.0.02 build 4 12/10/09
     The MTU thing  Ican figure out. click save OK. But what the heck  is
    Power cycle the router
    Un-plug it ?
    Sorry to  a pain.  Ready to throw this out the window.  It works good/great then very poor or not at all. In wireless mode.
     The other day on the lap top  a  friend was connected to a inter-active training video. for about 30 minutes, worked great.
     Then today the Dell with windows 7 lost the wireless conection.
    Thanks

  • KDE4 + wallpaper slideshow: few questions about performance / tuning.

    Hello,
    I am using KDE 4.4 from pacman and set my desktop activity to slideshow. I would like to customize few things and thus - I have few questions:
    1) Is it possible to change / disable transition effect when changing wallpapers? All my desktop is choppy and not responsive while the wallpaper changes and I am wondering if there is a way to repair this? (all images used as walls are at max 3MB big, usually something about 1MB. I have 7200 RPM disk, 2GB of ram and rather fast graphics card with newest Nvidia drivers, so I don't know what is the cause of slowdown...)
    2) How can I programatically progress wallpaper to next image (not with the right click / Next Wallpaper image)?
    3) Is there a way to disable the wallpaper change while there is a fullscreen application running? I am asking this, because when I watch HD movies and the wall changes, movie playback is really choppy... (I think that answer to the first question will also help me in this case).
    I would be glad for any sugestions / interest in helping me;)
    Best regards,
    Mike.

    Hello
    1/ There's no way I know to remove the transition. Using the "raster" graphics engine helps a lot on performance : kill plasma-desktop and launch  `plasma-desktop -graphicssystem raster`
    2/ There's a plasma applet for this :
    http://kde-look.org/content/show.php/Ne … tent=94251
    http://aur.archlinux.org/packages.php?O … twallpaper
    Maybe you can adapt it to your needs / find out how it works.
    Last edited by xvello (2010-05-16 16:20:24)

  • LOB question about performance, fragmentation etc.

    Well..
    I want to discuss the issues around LOB objects.
    If I have an enttity class with n-count fields and then a lob as the n+1th field, does this affect performance in any way ? E.g. if performance is random access for an object without a lob, does the performance get linear or something when the lob is introduced?
    Another one:
    If the latter is true: is it an option for me to use an @OneToOne mapping to compensate ?
    What about fragmentation ? How can a database or whoever compensate for fragmentation, in the case the lob is the n+1th field ? Or just in general: How the fragmentation issues are handled?
    (Im just thinking that lobs introduce fragmentation and brings performance down...)

    This will be san=me if you are considering the Local interfaces.
    For remote interface(like accessing EJB from Servlets resides in diffferent Apps Server) use the DTO(data Transfer Object) patterns.
    Regards
    Sushil

  • Interview Question about performance

    Could somebody answer this.
    You get a call from database user complaining the database is very slow. Network issue is ruled out and you can't access any GUI tools like OEM, TOAD and Spot Light. What v$ views and columns would you see to if there is any issue with the db.
    thanks in advance.

    Questions like this one can go many directions. Since it is only one user complaining, I might start with v$session, v$process, and v$sql to get the sql text she is executing and test it for performance as a stand-alone query. I might also watch v$session_wait to see if I can see any sign of active waits for various sessions. Of course, if the user is doing a DML, then I might look at v$lock to see if any uncommitted transactions are blocking the user.
    That is just a start. There are many places to look and many possible causes of slowdown.
    Of course, the usual first questions is 'What has changed?'

  • Question about performance (entities & data object)

    Hello:
    I know that this can be, maybe, a silly question, but I've got the doubt
    I get a local reference to a entity ( myEntityLocal ) and I'm going to get many values from it.
    For example
    myEntityLocal.getId();
    myEntityLocal getName();
    myEntityLocal.getAddr();
    etc etc
    My question is
    Would be better, in performance terms, to fill all fields into a data object myEntityData ) and retrieve them from it ?
    I mean
    myEntityData = myEntityLocal.getData() // where getData() calls getter methods on myEntityLocal
    myEntityData.getId();
    myEntityData.getName();
    myEntityData.getAddr();
    I think the result is the same because is a local reference, but I've got that doubt
    Thanks and regards

    This will be san=me if you are considering the Local interfaces.
    For remote interface(like accessing EJB from Servlets resides in diffferent Apps Server) use the DTO(data Transfer Object) patterns.
    Regards
    Sushil

  • Questions about Performing a clean install of Snow Leopard

    Hi I plan on performing a clean install of Snow Leopard. I've never done a clean install of any OS before. I have a couple of questions. Is it easy to do? is it safe? Is a clean install of Snow Leopard better than doing an upgrade?
    Do I have to format my new internal hard Drive that I recently installed or only my Main drive?? It's basically used to store movies and music. Any info is greatly appreciated

    Stuart Lawrence wrote:
    Hi I plan on performing a clean install of Snow Leopard.
    why and what exactly do you mean by clean install? install on an empty drive?
    I've never done a clean install of any OS before. I have a couple of questions. Is it easy to do?
    yes.
    is it safe?
    yes
    Is a clean install of Snow Leopard better than doing an upgrade?
    IMO, not if your system is working ok. doing an erase and install will buy you a lot of work migrating your data.
    Do I have to format my new internal hard Drive that I recently installed or only my Main drive??
    yes. boot from the snow leopard dvd, reformat your drive with disk utility (it's in the Utilities menu). set the partition scheme to GUID and format to MAC OS extended journaled. once the drive is reformatted, quit disk utility and proceed with the install.
    It's basically used to store movies and music.
    I don't understand, is it empty or does it have something on it already? all that stuff will be wiped out if you follow the above procedure.
    Any info is greatly appreciated
    I would recommend doing a regular install. just make sure you have a *full backup* before you do. a bootable backup using CCCloner or Superduper is teh best. a TM backup is ok too.
    BTW, you have posted this in the Time machine forum for leopard. this is really not the right place to ask this.

  • Question about Performance

    Hi 
        we have a Sql Server Azure dabase with a Standar 1 subscription.
        I make a test, inserting 400.000 records in a table, with 15 columns and one key (identity)
        I have made queries and the performance is very bad, for example:
                      - a group by one of the table fields spend 16 seconds returning 585 rows
         In other situations, the queries spend more than 2 minutes.
       is this normal for SQL AZURE?

    Hello Javier,
    Can you please share which edition of SQL Database you are using? You should check if you are maxing out the available resources of the edition you are. If so and you don't achieve your performance goals, you should consider using a higher performance level.
    The below article has some guidance:
    https://msdn.microsoft.com/en-us/library/azure/dn741336.aspx?f=255&MSPPError=-2147217396
    Thanks,
    Jan

  • A question about performance of a system.

    Quote from: XFM on 11-October-13, 04:19:18
    If you're having performance issues then start a new topic regarding that.
    There is a low FPS in the game "Tomb Raider" (less than 22). Could this be due to damage to the board or the old bios (version 1.7)?

    Not if everything else works fine...
    Sounds like drivers possibly need an update.

  • A question about performance of envy 15t-j000

    The windows 8 experience index of my ENVY 15 is 5.0, which is the subscore of desktop graphics performance.
    However, I found that the index shoulde be higher because the artical on http://www.theinquirer.net/inquirer/review/2290017/hp-envy-touchsmart-15-review/page/3 shows that the total index should be 5.9 with 6.6 on desktop graphics performance. The tech spec of my computer is the same with the one  in that article. Therefore, is there something wrong with my computer, for example, the driver for graphic card is not installed properly?
    Hope someone can provide me a solution. Thanks a lot.

    Not if everything else works fine...
    Sounds like drivers possibly need an update.

  • Question about performance in a code.

    Hi experts...
    I need to make a program to make a backp of one table and the a restore.
    The performance of this code is fine?? The tables contain a lot of records!
    PARAMETERS:
              p_backup    TYPE c AS CHECKBOX,
              p_rest      TYPE c AS CHECKBOX,
              p_del       TYPE c AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK bl2.
    IF p_backup IS NOT INITIAL.  "Cuando se seleccione para hacer backup.
    *Data Selection:
      SELECT mandt bukrs day_a racct prctr per_day average agregate agregate_m accumulate average_m day_exe
        FROM zavg_bal_table INTO TABLE t_avg.
      INSERT zavg_backuptable FROM TABLE t_avg.
    ELSEIF p_rest IS NOT INITIAL.  "Cuando se seleccione para hacer restore.
      SELECT mandt bukrs day_a racct prctr per_day average agregate agregate_m accumulate average_m day_exe
        FROM zavg_backuptable INTO TABLE t_avg.
      INSERT zavg_bal_table FROM TABLE t_avg.'
    ENDIF.

    Hi,
    you are taking a lots of records at one time, just split your results by adding "where" clause, here are a few examples of split:
    - by mandt             (very few splits, lot of records)
    - by day                
    - by initial name     (lot of splits, few records)
    procedure:
    read all mandt's into itab, loop itab doing select and insert
    NOTES:
    - of course splits and quntity of records depend of each table.
    - I suppose that lot of splits with few records are the best choice.
    best regards.

  • A question about performance in processing a string

    hi all
    i have a string that contains some text - few paragraphs. there are two specific words in the string that i need to search and replace with other stuff. my question is that :
    is it faster to process one line at a time to search two words(in a loop) or use the indexOf method of the String class to find one word at a time (process the text twice)? i don't really know how quick or efficient the indexOf method is. thanks in advance.

    The following program replaces "James" with "Jim" and "William" with "Bill".
    class Test111 {
        public static void main(String[] args) {
            String s = "James Gosling, William Gates, William Joy";
            System.out.println (s.replaceAll("\\bJames\\b", "Jim").replaceAll("\\bWilliam\\b", "Bill"));
    }It must print "Jim Gosling, Bill Gates, Bill Joy".

  • A question about performance ( ram issue? )

    Small question. I have a Macbook Pro unibody - it has a Corsair Solid State Drive in it. 4 gigs of ram. I have an external hard drive with a few hundred movies on it. Each movie's icon is notated with a picture of a flag where the movie's origin is. Anywho. When I click the HD to look at all my movies, it takes a bit for all of the pictures to load for the icons. Not only that when I scroll up or down some of the icon pics will disappear, then reappear. In other words - it's slow.
    I previously had 8gb of ram in my 17 inch pro (i have a 15 now) - and I don't remember having this problem - but i don't really remember much. My question is - do you think this is a ram issue, an external hard drive issue - as in, it's not super fast, or some other issue. What can i do so when i open this folder up, I don't have serious lag time for the icons to show up? I think it's not a ram issue, i'm guessing it's an external issue - not so much that the external has a problem just that it's now fast, but want to check here to make sure. thanks.

    How are you accessing the external harddrive? Firewire 800 is going to be faster than USB2.0 This I would expect, not RAM.
    A faster connection or a faster external HD I suspect would be the answer.

  • Question about division operators

    I have the following problem.
    I want to know how many times a certain number can be dived by another number. For example: the function with parameter 64/30 should return 2 (because 2 is the maximum number of times that 30 fits into 64.. What I don't want is the modulo of 64 and 30 (64%30 = 4).
    Is there a standard function for this one? How can do it? Thank you.

    You just answered your own question :) 64 / 30
    will equal 2, it's called integer division. So
    this:
    int x = 64;
    int y = 30;
    int result = x / y;
    System.out.println(result);will give you 2.16/2=8
    but:
    16/=2==8
    8/=2=4
    4/=2==2
    2/=2==1
    1/=2==0
    its 5 times. i think he didn't mean the first :-)
    int number=16
    int div=2;
    int n=0;
    while (number/=2 != 0) n++; // i think that your solution!

Maybe you are looking for