Stored procedures DONOT increase performance(.NET and SQL training video)

Поделиться
HTML-код
  • Опубликовано: 6 июл 2012
  • For more such videos visit www.questpond.com
    For more such videos subscribe ruclips.net/user/questpondvide...
    See our other Step by Step video series below :-
    Python Tutorial for Beginners:- • Python Tutorial for Be...
    Learn Data Science in 1 hour :- tinyurl.com/y5o7qbau
    Learn Power BI Step by Step:- tinyurl.com/y6thhkxw
    Learn MSBI Step by Step in 32 hours:- goo.gl/TTpFZN
    Learn Tableau step by step :- tinyurl.com/kh6ojyo
    Learn SQL Server Step by Step tinyurl.com/ja4zmwu
    Learn Angular tutorial step by step tinyurl.com/ycd9j895
    Learn MVC Core step by step :- tinyurl.com/y9jt3wkv
    Learn C# Step by Step goo.gl/FNlqn3
    Learn Design Pattern Step by Step goo.gl/eJdn0m
    Learn Azure Step by Step :- tinyurl.com/y6fmrech
    Learn SharePoint Step by Step in 8 hours:- goo.gl/XQKHeP
    When asked in .NET interviews compare Stored procedure VS Inline query the first thing that people answer is Stored procedures increase performance.In this video we will try to clear this misunderstanding that stored procedure increase performance. From SQL server 2005 onwards any SQL which comes to SQL server will be cached. So the performance using stored procedure or in-line queries are both same.

Комментарии • 59

  • @dnfvideo
    @dnfvideo  2 года назад

    Do not miss our Interview Question video series
    30 Important C# Interview Questions : ruclips.net/video/BKynEBPqiIM/видео.html
    25 Important ASP.NET Interview Questions : ruclips.net/video/pXmMdmJUC0g/видео.html
    25 Angular Interview Questions : ruclips.net/video/-jeoyDJDsSM/видео.html
    5 MSBI Interview Questions : ruclips.net/video/5E815aXAwYQ/видео.html

  • @gamccoy
    @gamccoy 9 лет назад +6

    Interesting video. I don't agree that inline SQL is just as efficient. If you are changing the SQL (say from method parameters), SQL Server is going to think it is a different query. The parameterized SPROC will still read be a cache hit. Also, the SPROC will not have the startup cost if it has been accessed within a certain amount of time. Your test app will always have the startup penalty when using inline SQL.

  • @jubinsingh931
    @jubinsingh931 10 лет назад +4

    hello Sir,
    the way you have taught us about Stored procedure was great.......and you are absolutely right that inline queries in sql 2005 servers and onwards do the same thing what Stored procedure do(About performance).....but if we do some little bit changes in the same query that we had previously executed like we can give some extra space in the same previous query
    for Example "select * from Table_name" this is our previous query and the modified query is "select * from (some extra space i have given their) Table_name"
    and when we execute the modified query so the new "Execution plan will be generate" but if we do the same thing in the query stored in stored procedure and then execute the stored procedure then it will not create a new "Execution plan"....it will take from cached....and then execute the query....i hope you will not mind,i just wanted to clarify the things...& if i am wrong then you are welcome to clear my myth....Thank you :)

    • @nuwanwimalasooriya9375
      @nuwanwimalasooriya9375 9 лет назад

      I also think, this video doesn't illustrate all the aspects. I agree with your comment. In msdn also, I saw this kind of idea. Actually SP is fast than in-line sql.

  • @MiddleEasternInAmerica
    @MiddleEasternInAmerica 12 лет назад +1

    all my thanks is all I have to give.
    thanks millions

  • @seankiernan6593
    @seankiernan6593 8 лет назад +2

    This video helped me a lot, thank you very very much :)

  • @satishnagotkar886
    @satishnagotkar886 7 лет назад

    Nice video - good effort to describe the things

  • @vijaykondal2063
    @vijaykondal2063 11 лет назад +1

    It really clear my doubt.
    thanks

  • @hardeepsaggi140
    @hardeepsaggi140 9 лет назад

    good video to get basics straight !! thanks :)

  • @srinivasrapaka4465
    @srinivasrapaka4465 10 лет назад

    nice and cool video.. realy good and helpfull to interview purpose also thank u lot

  • @SpikedHairWarrior
    @SpikedHairWarrior 7 лет назад +10

    Sps have a huge performance improvement compared to queries. Any dev can make basic valid test(this video doesn't actually test anything) and calculate the execution time and see a massive difference between them. This video should be deleted for giving junior devs the wrong idea.

  • @thesqaanalyst
    @thesqaanalyst 11 лет назад

    Great video and explanation. Thanks.

  • @gkmishra2009
    @gkmishra2009 4 года назад +1

    I given interview and got question on below please explain
    Asynchronous programming how achieve in #
    Reflection
    Extension Method
    We pass data from one app to another how we secure the data
    How secure Channel in network
    Collection can we use in multi thread env
    Concrete Dictionary
    mediatype
    app/json and text/json
    what are Azure Services you used
    SOLID
    Benefits of View
    How delete Views work

  • @GunaNidhiPokhrel
    @GunaNidhiPokhrel 9 лет назад

    good effort to describe the things

  • @hrudayaranjanmohanty2689
    @hrudayaranjanmohanty2689 2 года назад

    Very use full video sir..

  • @iampaddyofficial
    @iampaddyofficial 11 лет назад

    very useful information... Thanks Shiv

  • @MohammedDawoodAnsari
    @MohammedDawoodAnsari 12 лет назад

    Thanks to you, you are the best....

  • @DummyFace123
    @DummyFace123 Год назад

    In general you’ll end up having a much easier time hypertuing a database that’s all stored procedure, especially on complex stuff, there’s no other option that to perform the complex work in the memory of the the actual machine instead of from a remote webserver. As well as having a machine with tools and a language fine tuned to dealing with relational datamodels.

  • @MFurqanKhan
    @MFurqanKhan 10 лет назад +4

    Instead of getting into debate how parameters work for inline query try executing an inline query with different parameters and see what profiler shows. Then try executing a SP with different parameters and then see what profiler shows.
    I am sure your results will enlighten us all.
    According to my results on SQL Profiler "Cache Insert" is called for inline query each time parameters are changed. Whereas for SP "Cache Hit" is called each time parameters are changed except for first time.

  • @sureshsl985
    @sureshsl985 7 лет назад +3

    The one more advantage I can see in using Stored Procedure is, sql injection will be avoided.

  • @girish9841
    @girish9841 7 месяцев назад

    Best explanation sir

  • @dhirajkatekar6323
    @dhirajkatekar6323 10 лет назад +2

    i have a doubt that does inline query gonna make difference to the network traffic as compared to the stored procedures. If we are using inline query we need pass whole query through the network whereas in stored procedure we just need to pass parameters and procedure name if am not wrong. And disadvantage to using inline query is that whenever we need to make certain changes to query we will have to stop the application and in case of stored procedure we just have to make changes to the database which is quite efficient as per the developer point of view.

  • @Eshamohit
    @Eshamohit 11 лет назад

    very good explanation.

  • @paulorocha1975
    @paulorocha1975 12 лет назад +1

    Hmm, how will it behave if you send different combinations of usernames and passwords to the stored procedure and to the inline SQL? Won't you get a different hash value every time you run the inline sql? If one wants to use inline sql would't it be better to just use parametrized queries?

  • @manurajbharall
    @manurajbharall 11 лет назад

    The same concept is work for Oracle also, or there may be same different mechanism in Oracle.

  • @sudhirmalireddy
    @sudhirmalireddy 12 лет назад

    very nice and good explanation

  • @swanky234
    @swanky234 11 лет назад

    Tnx for these videos !

  • @MarieAdventure
    @MarieAdventure 12 лет назад

    excellent! you rock! do you have a tutorial about metro style app?

  • @nohandle8008
    @nohandle8008 12 лет назад

    Great info, new subscriber; thanks!!!

  • @khaled344
    @khaled344 11 лет назад

    Well said, thanks

  • @jzhuo
    @jzhuo 11 лет назад

    very cool, definitely didn't know that one.

  • @hawkbala456
    @hawkbala456 8 лет назад

    Your activity is definitely worth .. :)

  • @mitesh7272
    @mitesh7272 10 лет назад

    nice work.....

  • @msg2swaroop
    @msg2swaroop 11 лет назад

    thanks for info...

  • @stevesmith2165
    @stevesmith2165 11 лет назад

    Good video.

  • @prashantjadhav5440
    @prashantjadhav5440 11 лет назад

    thanks for sharing

  • @0Pain0Gain
    @0Pain0Gain 6 лет назад

    if you keep changing the username and password (text inputs) then there will be multiple plans created for each dynamic sql (since the hash will be different each time...not ideal..will result in plan cache pollution)...better use parameters and sp_executesql or stored procedures...also this way of string concatenation poses a sql injection threat...ORMs typically send out parameterized sp_executesql calls (can be verified by the Profiler) and therefore can re-use plans from the cache (that's why they are faster)...but with anything else it can be misused too :-)

  • @sabyasachideKol
    @sabyasachideKol 9 лет назад +2

    Not agreed .. why only cached? Stored Procedure are compiled where as inline queries get compiled every time. So ofcourse performance basic SP's are better

  • @swanky234
    @swanky234 11 лет назад

    its Cool ...!

  • @vikrampatel4033
    @vikrampatel4033 5 лет назад

    Nice. I am using linq2sql

  • @GurjeetSingh-tl1yv
    @GurjeetSingh-tl1yv 9 лет назад

    Nice video...removing developers misconception on stored procedures...

  • @retry51776
    @retry51776 8 лет назад +1

    Only simple query plan will be cache, when a complex query, cache most likely be clear within minutes.

  • @sumitrakumar3956
    @sumitrakumar3956 5 лет назад

    nice vidoe

  • @bizzarrazzib
    @bizzarrazzib 12 лет назад

    how can I insert cache to stored procedure?

  • @msushami
    @msushami 9 лет назад

    Then What is the difference b/w stored procedures and inline query ???
    G+

  • @MFurqanKhan
    @MFurqanKhan 12 лет назад +1

    I think scenario given by @paulorocha1975 is enough to decline the logic explained in this video. i.e. inline query will insert cache each time it's parameter value is modified whereas SP will always use existing cache regardless of parameter values.

  • @ukdcj
    @ukdcj 10 лет назад

    hey thanks, its helpful

  • @moustafa12210
    @moustafa12210 7 лет назад +1

    You just tested, that sp query and inline query are being cached. but you didn't measure all the pipeline performance for each one starting from parsing, compiling, analysing, optimising, etc. also simple query not enough to be a fear measurement, you should figure out many inputs and cases. finally to mention this is just query operation but what about a whole picture of crud processing in a large set of transactions scope. I disagree. sp increase performance.

  • @Katerine459
    @Katerine459 9 лет назад

    While you neatly explained that stored procedures aren't more efficient than inline functions (in situations where what you intend to do is even *possible* from an inline statement... I always thought stored procedures were for things that you can't do inline)... there is one glaring problem with this video, in that the example inline SQL that you wrote is totally vulnerable to SQL Insertion, and should never be used in examples of valid code. Going by the video, the procedure route appears to still be light-years better, not because of performance, but because it uses parameters instead of allowing user-created inputs to go directly into the SQL, leaving the database wide open to hackers.

  • @rahulraj3898
    @rahulraj3898 5 лет назад

    Video is not clear about the cache for plane sql statement . Lets check by changing the parameters

  • @breaktime6125
    @breaktime6125 6 лет назад

    your thought is wrong. if you pass parameter value both sp and normal query it will show different
    change parameter and pass parameter:
    SP--> cach insert ,catch hit,catch hit,catch hit,catch hit,catch ..........
    nomal query --> cach insert,catch hit,cach insert,catch hit,cach insert,catch hit,cach insert,catch hit..

  • @AltafHussainnagri
    @AltafHussainnagri 10 лет назад

    then what is the difference. why we need to create store procedure????

  • @sumitkumarsingh8179
    @sumitkumarsingh8179 4 года назад

    But when parameters changed then......

  • @himanshu2811
    @himanshu2811 12 лет назад

    it happens automatically.

  • @tseringlobsang1789
    @tseringlobsang1789 7 лет назад

    Your title is a bit misleading because, basically the ORM frameworks kill the performance.

  • @MG_On_Wheels
    @MG_On_Wheels 7 лет назад

    I know your intention was to explain that there is no difference in performance if same query or proc is shot next time, it will always find plan in plan cache. But while doing so you used wrong examples and explanation. Inline query should be avoided at any point of time from app for many reasons and security being on top in it. In my view when we try to explain certain abstract of a technology in a Demo, we should be very specific about the explanation and examples to support that. Otherwise you would spend another two classes to explain that it was wrong practice OR example.

  • @doug65536
    @doug65536 11 лет назад

    Let's hope the user doesn't enter this in the user name field: '; delete from users; --