Performance difference between LIKE and "="

May I know what will be the performance difference for
select * from a where b = 'C'
v.s.
select * from a where b like 'C'
In general, we don't notice any performance difference in using "LIKE" but under some situation we do. Any idea why?

Equality is a relatively easy thing for the cost-based optimizer (CBO) to handle, so it is far more likely that it will generate the "right" query plan.
It is a lot more difficult for the CBO to estimate how many rows a LIKE query will return, particularly since the vast majority of LIKE clauses have wild-cards. I would not be suprised if the CBO were occasionally generating incorrect plans if you are using LIKE where you could be using =.
Justin

Similar Messages

  • Graph axes assignment: performance difference between ATTR_ACTIVE_XAXIS and ATTR_PLOT_XAXIS

    Hi,
    I am using a xy graph with both x axes and both y axes. There are two possibilities when adding a new plot:
    1) PlotXY and SetPlotAttribute ( , , , ATTR_PLOT_XAXIS, );
    2) SetCtrlAttribute ( , , ATTR_ACTIVE_XAXIS, ) and PlotXY
    I tend to prefer the second method because I would assume it to be slightly faster, but what do the experts say?
    Thanks!  
    Solved!
    Go to Solution.

    Hi Wolfgang,
    thank you for your interesting question.
    First of all I want to say, that generally spoken, using the command "SetCtrlAttribute"is the best way to handle with your elements. I would suggest using this command when ever it is possible.
    Now, to your question regarding the performance difference between "SetCtrlAttribute" and "SetPlotAttribute".
    I think the performance difference occures, because in the background of the "SetPlotAttribute" command, another function called "ProcessDrawEvents" is executed. This event refreshes your plot again and again in the function whereas in the "SetCtrlAttribute" the refreshing is done once after the function has been finished. This might be a possible reason.
    For example you have a progress bar which shows you the progress of installing a driver:
    "SetPlotAttribute" would show you the progress bar moving step by step until installing the driver is done.
    "SetCtrlAttribute" would just show you an empty bar at the start and a full progress bar when the installing process is done.
    I think it is like that but I can't tell you 100%, therefore I would need to ask our developers.
    If you want, i can forward the question to them, this might need some times. Also, then I would need to know which version of CVI you are using.
    Please let me now if you want me to forward your question.
    Have a nice day,
    Abduelkerim
    Sales
    NI Germany

  • Is there any performance difference between unique and no unique index

    Hi,
    We are working with both databases Oracle and MS-SQL and we have an open channel to MS-SQL server core team.
    We got the word from them that there is a difference between unique and no unique index from the optimizer perspective, i.e. the optimizer knowing that the index is unique may choose a more suitable plan for running a specific query, we're still trying to find a specific example.
    Anyway, since we do not have an open channel to Oracle core, I thought maybe one of you guys knows something about Oracle optimizer behavior on this issue.
    I am interested verified answers from certified sources and not suggestions or thoughts.
    Thanks in advanced,
    Tal ([email protected]).

    Maybe, you will like to check this link for a similar question answered by Tom Kyte
    http://asktom.oracle.com/pls/ask/f?p=4950:8:385900000490041683::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:7641143144618,

  • Difference between 'LIKE' and 'TYPE'

    Hi all,
    I am new to learning ABAP, kindly bear with my naive questions.........
    can you please tell me what's the difference between 'type' and 'like' keyworkds.
    also what does 'condense' do.
    thanks
    Sabrina.

    Hi Sabrina
    Check out Re: Diff b/n 'type' n 'like'

  • Difference between LIKE and =

    All,
    I know that theoratically LIKE operator is slower compared to = operator especially when using fixed string but how do I demonstrate it. Explain plan gives me the exact same execution plan and there is no difference to prove my point. Below is the statement and respective execution plan:
    SQL> select * from emp where ename like 'FORD';
    Execution Plan
    Plan hash value: 2564639655
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 37 | 2 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| EMP | 1 | 37 | 2 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | ENAME_IDX1 | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("ENAME" LIKE 'FORD')
    Statistics
    0 recursive calls
    0 db block gets
    3 consistent gets
    0 physical reads
    0 redo size
    823 bytes sent via SQL*Net to client
    396 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    SQL>
    SQL> select * from emp where ename = 'FORD';
    Execution Plan
    Plan hash value: 2564639655
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 37 | 2 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| EMP | 1 | 37 | 2 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | ENAME_IDX1 | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("ENAME"='FORD')
    Statistics
    0 recursive calls
    0 db block gets
    3 consistent gets
    0 physical reads
    0 redo size
    823 bytes sent via SQL*Net to client
    396 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    1 rows processed
    SQL>
    Db : Oracle 10g
    OS : windows XP
    The plan remain same even after analyzing the table without which only "- dynamic sampling used for this statement" method was used but after the statistics calculation, dynamic sampling is gone.
    Any thoughts?
    TIA

    Hi,
    Differrence between LIKE and = is LIKE will return the all the with what you give.= will return exact value of what you give.
    For example,
    create table emp(id number,emp_name varchar2(10));
    insert into emp values(1,'john paul');
    insert into emp values(2,'paul');
    insert into emp values(3,'fame');
    LIKE Example :
    select * from emp where emp_name like '%paul%';
    id emp_name
    1     john paul
    2     paul
    In this query,the query will return who all are having paul in thier names.
    = Example :
    select * from emp where emp_name = 'fame';
    id emp_name
    3     fame
    This query will return exact who have name paul.
    Regards,
    Fame

  • Performance difference between page and scroll

    Hi experts:
    What is the technical difference between paging and scrolling, especially as pertains to database access and performance?  The scenario would be a table result in a view where 200 results exist for a query.  A scrollable table would show all results, while the paging table would show 10/20 per page.  Is the database selection the same for both approaches?  Or is the paging approach going to make more trips?  If there are trips - how does the UI know how many pages should be presented?  Is one or the other a better approach for data which is not existing in CRM system?
    regards,
    bill.

    If you look at the servlet translated from a JSP, you'll see these lines:
    Object page = this;
    pageContext = _jspxFactory.getPageContext(this, request, response,
                null, true, 8192, true);
    _jspx_page_context = pageContext;
    application = pageContext.getServletContext();So page is simply an alias for this.
    And PageContext is analogous to ServletContext but please notice, it's not the same or a replacement; application is the implicit reference to ServletContext and not pageContext. There is no equivalent of pageContext in servlets.
    Please note that the page scope doesn't refer to the page object but to the pageContext. Therefore, what Manivel said above
    page is used as a scope with in one jspisn't correct.
    Edited by: nogoodatcoding on Sep 24, 2007 1:30 PM

  • Performance difference between 6490M and 6750M?

    I'm looking at a new 15" MBP. What performance difference will I likely see between the Radeon 6490M and 6750M? It's a huge jump in graphics memory, but how much will it help me? I'm not a gamer at all, but I do a fair amount of work with photos and video.
    Thanks!

    Since you don't play games, you'll notice a difference in graphic and video applications that are GPU accelerated, like Motion, and Photoshop CS4 & 5.

  • Difference between "Like" and "Type" addition

    Hi abapers,
    I have doubt regarding the purpose and use of the additions "LIKE" and  "TYPE" with respect to variable(data objects). Please look into the following code,
    Data:numb1 type i value 30.
    Data:numb2 like numb1."Will the value 30 get copied to numb2
    write : / numb1, numb2.
    My question is while using "LIKE" addition with variables, will the value also get copied into the variable. That is, will the value 30 be copied into numb2 or only the technical attributes of numb1 will be copied into numb2.
    Another doubt is can we the following code in abap,
    Data : int_tab_1 type mara.
    Data : int_tab_2 like mara.
    Are they both same? If not what is the difference between them?

    hi
    when ever you declare a  data object of abap predefined objects or types that are created by using TYPES statement we use TYPE addition to declare a variable.
    if we try to declare a object which is already existing in the program for having the same technical attributes then we declare by using LIKE addition.
    ex
    TYPES:
       begin of fs_emp,
          name TYPE string,
       end of fs_string.
    data :
       w_i TYPE i,
       w_emp TYPE fs_emp.
    now if we want to create a data object which is having the same attributes of fs_emp then we can declare by using LIKE statement 
    data :
       w_employee LIKE w_emp.
    when u are using like then the object should already exists in the program
    regards
    PAVAN

  • Performance Difference between DBCO and PI techniques

    Hi all,
    I want to analyse the performance of inserting records in CORP tables using DBCO connection.
    Can any body please explain which technique is better either using DBCO connection or using PI interface technique.
    Thnaks
    Nitesh

    Since you don't play games, you'll notice a difference in graphic and video applications that are GPU accelerated, like Motion, and Photoshop CS4 & 5.

  • Performance difference between sqlj and jdbc

    hi:
    i am working with a project and i have to generate text files
    from database . first i am working with pl/sql, but i am not so
    satisfied with the performance. so i turn to java stored procedure. I have two choice sqlj and jdbc when accessing
    database? which performs better? sqlj or jdbc? or there's only
    little difference.
    And would u like to give me some other choice to run faster.
    maybe pro*c/c++ is a choice . but if it can't run much faster ,
    it's not a better choice.
    regards

    Since you don't play games, you'll notice a difference in graphic and video applications that are GPU accelerated, like Motion, and Photoshop CS4 & 5.

  • Performance Difference Between 2gb and 4gb on a MacBook Pro

    Hi Guys,
    About to make the big purchase. I am wondering what is the proformance difference between 2gb of ram and 4gb of ram on the new MacBook Pro?
    Thanks
    ll

    I upgraded my new late 208 mbp and have been having ram problems ever since. My computer keeps locking up usually during video play and makes screeching noises and has weird 1 inch thick horizontal lines that go across my screen when it happens. I have to do a hard shutdown. I called macsales.com where i got the OWC memory and they said there is an issue with the video drivers and the third party memory. I have already had a replacement computer from Apple and it is still happening on a different computer. i did a fresh install of the OS but still having it. So be aware....it's already happened on two computers for me!

  • Dual 24" cinema displays - performance difference between 6490M and 6750M?

    Hi,
    I am running 2 x 24" Apple Cinema displays and need to choose between the 2.2ghz i7-2635QM and 2.0ghz i7-2720QM MacBook Pro 15" offerings. They come with the 256mg HD 6490M graphics and the 1gb 6750M graphics.
    I do a bit of Photoshop CS3 (once a month), rarely any video rendering.
    But as I run dual monitors (via a Matrox DualHead2Go DP edition) I am keen to find out if the extra £300 for the higher spec will actually assist my usage.
    Its currently running on a MacBook Pro 6,2 2.4ghz early 2010 model. It runs fine on this.
    Thanks
    Eric

    Can't help with your question, but wondering what video adapter you are using to connect 2x Cine Display to your MacBook Pro as I'd like to do the same.
    KD

  • Display Performance Difference between CS3 and CS4

    I have a computer running CS3 and a computer running CS4. When I place an image in InDesign CS3, it looks way better than when I place it in CS4. The display performance for both computers are set exactly the same. Raster and Vector images are set to proxy, transparency is set to medium quality, Anti Aliasing is turned on.
    The CS4 computer:
    Processor Name: Dual-Core Intel Xeon
    Processor Speed: 2.66 GHz
    Number Of Processors: 2
    Memory 4GB
    System Version: Mac OS X 10.5.8 (9L31a)
    CS3 computer:
    Processor Name: PowerPC G5
    Processor Speed: 2 GHz
    Number Of Processors: 2
    Memory 4GB
    System Version: Mac OS X 10.5.8 (9L31a)
    What am I missing? It is virtually every image.

    "You can adjust the quality of the the display itself without altering the name of the setting."
    Tried that. The end result is viewing images at the higher quality that slows down the machine.
    "Also, the size and resolution of images plays a role in how large the previews are, and their quality."
    The difference is very noticeable when the exact same image is placed at the exact same sizes in InDesign CS3 and CS4. Everything in the workflow remained the same, except the changing of InDesign files.

  • Performance difference between 1gb and 2gb RAM for Leopard

    Hi ..
    I'm thinking of upgrading to a 2gb Ram.
    Would like to know if other users saw a major increase in speed & performance in Leopard.
    Thanks.

    No, I didn't see any appreciable speed increase in Leopard, but the increased RAM should help.

  • Performance difference between InfoCube and ODS

    Hello guys,
    I have to implement a data contrainer with round about 40 millions entries and more than 50 characteristics/items.
    The question is fairly easy - what kind of data contrainer (ÍnfoCube or ODS-Object) is more powerful on reporting aspects, adopted i set up secondary indexes for specific characteristics on the ODS-Objekt or use line item dimensions for same characteristics at an InfoCube.
    Thx 4 advise
    Markus

    Hi Markus,
    from the point of view of reporting Cubes offer powerfull tools for improving performances.
    One of the most important is the logical partitioning: if you have different years in your data you can split cubes for year and then aggregate all with a MultiProvider.
    The system during query run will split the single query into several queries reading in parallel the single cubes under the Multiprovider.
    Check in Business Intelligence area of SDN, you will find a document for performance improvement.
    Ciao.
    Riccardo.

Maybe you are looking for