Time consuming keywords in T-SQL

  • Hi all,

    Can someone tell me

    1. which T-SQL keywords use more time than others? I want to know the list.

    2. If you have any links for this, please share me.

    Currently, I need to do modification for an existing Database hosted on SQL Server 2000.

    I'm not a DBA, so please kindly don't assume I know how SQL Server works.

    I'm a programmer, I know basic knowledge about SQL Server and its tools.

    Hope you will understand what I'm trying to say.

    Thanks.

  • The most common statement in SQL is SELECT. Others are INSERT, UPDATE, and DELETE.

    Let me put it to you this way, you shouldn't use ANY of them until you have more knowledge than you do now. If you are taking over from someone who had some skills then making changes would only make a bad situation worse.. Don't make any changes until you understand the language and what is happening..

    CEWII

  • I wouldn't say that any key words are more time consuming than others. A Select with no where clause will likely take more time to complete than an update or delete with a where clause limiting the action to 1 row. Really the entire statement, database design, and data determine what will take longer.

  • Assuming you're trying to work with more than just a few rows per table (or more than one table) I'd consider keywords like CURSOR or WHILE as being a time consuming approach.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Have a look at these links:

    http://qa.sqlservercentral.com/articles/Performance+Tuning/2924/

    http://stackoverflow.com/questions/543580/equals-vs-like

    It is not an easy question to answer because it all depends on what you are doing. Use the Execution plan to show where the most time is being spent in your queries. For example using SELECT DISTINCT can add a delay to a query, but there are occasions when it does exactly what you want.

    Hope this helps.

  • It depends, and that's the best answer. It's how you use the keywords, not the keywords.

    I'd say that you ought to engage someone to help you tune things if you are having performance problems and sit with them to learn why they make changes.

  • scsfdev (8/23/2009)


    Hi all,

    Can someone tell me

    1. which T-SQL keywords use more time than others? I want to know the list.

    2. If you have any links for this, please share me.

    Currently, I need to do modification for an existing Database hosted on SQL Server 2000.

    I'm not a DBA, so please kindly don't assume I know how SQL Server works.

    I'm a programmer, I know basic knowledge about SQL Server and its tools.

    Hope you will understand what I'm trying to say.

    Thanks.

    Definitely understand what you're asking. Simply put, keywords aren't going to be the thing that makes a difference in performance.

    Do you have a specific proc that you're trying to improve the performance on? If so, and you'd like some help on it, you could post it here and we'll see what we can do to help. (Or more than one, if that's the case.)

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply