• Bhuvnesh (12/20/2012)


    Bhuvnesh (12/20/2012)


    Sean Lange (12/20/2012)


    pr.price <> 9999.99

    Try making this a SARGable predicate by removing the <> and replacing with > OR <

    pr.price < 9999.99 OR pr.price > 9999.99

    new learning for me. i am straight away going to test it 🙂

    Sean , i did a test btu result are not impressive or i am overlooking somthing (OR amount of data is small ? )

    It was low hanging fruit and only likely a piece of the puzzle. We did get ddl but without any data it is hard to test performance.

    The reason you are not seeing any difference in your two queries is because you are selecting only from a single table which is going to be an index scan. Are you familiar with SARGability? Not equals is a nonSARGable predicate. Do a quick search for sargable and you will find lots of material covering the topic.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/