Erik Darling (Erik Darling Data)
Erik Darling (Erik Darling Data)
  • Видео 387
  • Просмотров 308 544
An Advanced SQL Server Query Profiling Technique
Become a member! www.youtube.com/@ErikDarlingData/join
Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK
If you like what you see here, you'll love my advanced performance tuning training:
training.erikdarling.com/?coupon=SPRINGCLEANING
Script:
gist.github.com/erikdarlingdata/058c649d950c06a17f2c001d78355d41
Просмотров: 643

Видео

The Broken fn_xe_file_target_read_file DMF In SQL Server
Просмотров 2149 часов назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING Vote on the feedback item: feedback.azure.com/d365community/idea/5f8e52d6-f3d2-ec11-a81b-6045bd7ac9f9
Of RECOMPILE Hints And Query Store: Where Are My Parameter Values?!
Просмотров 23911 часов назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
Another Video For My Friend Brent About Automatic Tuning
Просмотров 49113 часов назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
A Video For My Friend Brent About Automatic Tuning
Просмотров 88416 часов назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
Why You Should Always Use Unicode For Dynamic SQL
Просмотров 68418 часов назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
How To Get Rid Of NOLOCK Hints Forever
Просмотров 712День назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
Advanced String Searching In SQL Server
Просмотров 1 тыс.День назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
A Little About Paging Queries And Batch Mode In SQL Server
Просмотров 861День назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING Paul White articles: 1. qa.sqlservercentral.com/articles/optimising-server-side-paging-part-i 2. qa.s...
A Little About Working With Binary and Varbinary Data In SQL Server
Просмотров 427День назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
A Little About Cardinality Estimation Feedback In SQL Server 2022
Просмотров 51914 дней назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
A Little About Optimizer Timeouts In SQL Server
Просмотров 47214 дней назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
Help! My Query Runs Too Long To Get An Actual Execution Plan!
Просмотров 50014 дней назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
More Of What Missing Index Requests Miss In SQL Server
Просмотров 38114 дней назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
What Missing Index Requests Miss In SQL Server
Просмотров 57514 дней назад
Become a member! www.youtube.com/@ErikDarlingData/join Click here for 50% off a health check: training.erikdarling.com/darling-data-health-check?coupon=HEALTHCHECK If you like what you see here, you'll love my advanced performance tuning training: training.erikdarling.com/?coupon=SPRINGCLEANING
New Query Transformation Rules in Azure SQLDB
Просмотров 38621 день назад
New Query Transformation Rules in Azure SQLDB
A Little About Parallel Insert Restrictions In SQL Server
Просмотров 41021 день назад
A Little About Parallel Insert Restrictions In SQL Server
Another Trick For Working Around Scalar UDF Inlining Restrictions In SQL Server
Просмотров 35021 день назад
Another Trick For Working Around Scalar UDF Inlining Restrictions In SQL Server
A Little About Function Rewrites In SQL Server
Просмотров 98421 день назад
A Little About Function Rewrites In SQL Server
Diagnosing and Fixing tempdb Contention from Spills in SQL Server
Просмотров 92421 день назад
Diagnosing and Fixing tempdb Contention from Spills in SQL Server
More Annoyances With Local Variables And Optimize For Unknown Hints In SQL Server
Просмотров 54728 дней назад
More Annoyances With Local Variables And Optimize For Unknown Hints In SQL Server
A Little About FORCESEEK Hints In SQL Server
Просмотров 615Месяц назад
A Little About FORCESEEK Hints In SQL Server
Performance Tuning Semi and Anti-Semi Joins In SQL Server
Просмотров 739Месяц назад
Performance Tuning Semi and Anti-Semi Joins In SQL Server
SQL Server Performance Problems When Joins Have No Equality Predicate
Просмотров 1 тыс.Месяц назад
SQL Server Performance Problems When Joins Have No Equality Predicate
A Little About DOP and Bitmaps In SQL Server
Просмотров 603Месяц назад
A Little About DOP and Bitmaps In SQL Server
Inconsistent Error Handling By SQL Server
Просмотров 542Месяц назад
Inconsistent Error Handling By SQL Server
A Little About Index Intersection Query Plans In SQL Server
Просмотров 561Месяц назад
A Little About Index Intersection Query Plans In SQL Server
A Little About Index Union Query Plans In SQL Server
Просмотров 562Месяц назад
A Little About Index Union Query Plans In SQL Server
A Little About Nested Loops Prefetching In SQL Server
Просмотров 624Месяц назад
A Little About Nested Loops Prefetching In SQL Server
How Many Threads Can One Query Use In SQL Server?
Просмотров 992Месяц назад
How Many Threads Can One Query Use In SQL Server?

Комментарии

  • @sakauk7566
    @sakauk7566 10 часов назад

    Hi Erik , will that query work with SQL 2019?

    • @ErikDarlingData
      @ErikDarlingData 8 часов назад

      Yes, it may work back to 2016 IIRC, but I can't really try it at the moment.

  • @clerincg
    @clerincg 11 часов назад

    Cool way to get "under the hood" while the car is going down the highway 😎 Was there a resolution to the single-threaded Index (Eager Spool) operation that would have actually run in parallel like the other Clustered Index operation?

    • @ErikDarlingData
      @ErikDarlingData 8 часов назад

      Eager index spools are always built single threaded, likewise the table that the index is built from is read from single threaded. There is no resolution aside from creating the index yourself, if you're on Enterprise Edition.

  • @darrylw99
    @darrylw99 20 часов назад

    Should there be a significant execution time difference between the serial v Parallel version? the serial ran in 1m 23s and the parallel in 1m 18s

    • @ErikDarlingData
      @ErikDarlingData 16 часов назад

      Yes, I talk about the main reason why in the video too 😘

  • @FlaggedStar
    @FlaggedStar 23 часа назад

    1:11 No love for GetPlans = 2?

  • @RomanPeralta
    @RomanPeralta День назад

    The best SQL Server training on internet (EDD) could use some links to these too many great videos as complementary material ;)

    • @ErikDarlingData
      @ErikDarlingData 16 часов назад

      If you feel like doing those annotations, go for it. Otherwise, I'm planning on redoing and expanding the training content with the stuff that's here as well.

  • @BrandonChampion
    @BrandonChampion День назад

    What's impressive is you not only have to put in all the effort and research to discuss a topic, you also have to intentionally craft queries that demonstrate the problems related to it.

    • @ErikDarlingData
      @ErikDarlingData 16 часов назад

      Do what you love and you'll never take a day off!

  • @aldore13
    @aldore13 День назад

    Darling for President!

  • @stephenlawrenson2380
    @stephenlawrenson2380 2 дня назад

    Is it a bug - or is it a feature??😂😂😂😂

    • @ErikDarlingData
      @ErikDarlingData День назад

      I'm gonna go with bug on this one.

    • @stephenlawrenson2380
      @stephenlawrenson2380 День назад

      @@ErikDarlingData so would I - I just put my MS Head on for a minute- although I didn’t take the job with them!

  • @FlaggedStar
    @FlaggedStar 3 дня назад

    I feel a powerful urge to do more Postgres. How strange.

  • @douglascoats7081
    @douglascoats7081 3 дня назад

    *slaps the enterprise level Ferrari, You can fit SO much garbage code in this bad boy

    • @ErikDarlingData
      @ErikDarlingData 3 дня назад

      If only there were Ozempic for bad code.

    • @douglascoats7081
      @douglascoats7081 3 дня назад

      ​@@ErikDarlingData I like the idea of bad code bulimia.

  • @jackiecooper9439
    @jackiecooper9439 3 дня назад

    Me: Where DocDate = '20241018' SQL server: English, other ducker Doo. you speak it? Me: Where DocDate >= '20241018' And DocDate < '20241019' Sql Server: See it wasn't that hard, was it?

    • @ErikDarlingData
      @ErikDarlingData 3 дня назад

      Well, the time element does make approximations for equality predicates difficult.

  • @nezbrun872
    @nezbrun872 3 дня назад

    At last, an antidote to Brent's arrogasms.

  • @AllenAchaemenes
    @AllenAchaemenes 3 дня назад

    Lets us accept the fact that Erik is the Michael Jordan of performance tuning and Brent is, well I am open to ideas.

    • @ErikDarlingData
      @ErikDarlingData 3 дня назад

      I think the only thing I have in common with Michael Jordan is shoe size.

  • @LeonardoCursi
    @LeonardoCursi 4 дня назад

    providential video, I was just having a problem of "I, sql server command, I create unquestionable plans" when instead there are indexes that he does not want to use

  • @BrentOzarUnlimited
    @BrentOzarUnlimited 5 дней назад

    Much better! Of course, with the real-sized Stack database, getting that query to finish 20 times would be quite an ordeal....

    • @ErikDarlingData
      @ErikDarlingData 5 дней назад

      It would require significantly more patience, sure.

  • @FlaggedStar
    @FlaggedStar 5 дней назад

    We need to find a way to get a third video on this... Maybe we need to get Erik to rant about features that aren't available on Standard Edition. I'm pretty sure this is one of them.

    • @ErikDarlingData
      @ErikDarlingData 5 дней назад

      Who would listen?

    • @vanwoudt
      @vanwoudt День назад

      The third video is about rewriting the automatic tuning query to run on lower compat levels...

  • @JesseSlicer
    @JesseSlicer 5 дней назад

    With the focus on fairness, maybe it's time to update your slogan to "my rates are reasonably fair."

    • @ErikDarlingData
      @ErikDarlingData 5 дней назад

      Then I'd have to change my trademark application.

  • @jiridolezalcz
    @jiridolezalcz 5 дней назад

    Useful, many thanks. I wonder if there is any possibility for automation or code-smell-checking? Developer is a human beeing not fully concentrated for all of the details that should be met everytime.

    • @ErikDarlingData
      @ErikDarlingData 5 дней назад

      I haven't seen any good ones publicly available, no.

  • @tmlslvn
    @tmlslvn 5 дней назад

    Awesome Erik! Updated my tips repo 🤫

  • @DBNinj4
    @DBNinj4 5 дней назад

    Anyone complaining about long videos has obviously never spent hours troubleshooting code, only to find that the code is fine but the datatypes act differently under different collations.

    • @ErikDarlingData
      @ErikDarlingData 5 дней назад

      HAHAHA, you know, that's a really funny point.

  • @FlaggedStar
    @FlaggedStar 6 дней назад

    Pay no attention to the name of the stored procedure. It is surely not making fun of anybody! Great video 😀

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      Ha ha, that's me being salty that I never got one.

  • @duendeacdc
    @duendeacdc 6 дней назад

    Man I love you,I love Brent I love Kendra...you guys are my hero ! 9 years as a DBA now and since day 1 I'm with Brent and Kendra and I remember when you joined the team. thanks for everything !

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      Yes, it was quite an astounding thing to have worked with them for a time. I wouldn't be where I am today without that experience.

  • @gotqn2103
    @gotqn2103 6 дней назад

    That's epic 😂

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      Well, I thought it was a bit odd that people kept bringing it up to me. There were a couple more examples that were buried in Twitter/LinkedIn feeds I couldn't find quickly.

  • @adrian_sanchez
    @adrian_sanchez 6 дней назад

    *"Oh gosh, it sounds like real trouble, it sounds like a job....for Darling Data"* .... (I know, I know, it's in jest). Entertaining though. Hope he gets you back

  • @BrentOzarUnlimited
    @BrentOzarUnlimited 6 дней назад

    Awww, man, c'mon, that's not fair - you used a different query, hahaha. The video was begging people to get automatic tuning to work for that particular query in the post.

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      I learned from SQL Server masters to never watch other people's videos 😘

    • @BrentOzarUnlimited
      @BrentOzarUnlimited 6 дней назад

      @@ErikDarlingData HAHAHA, that's fair.

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      A more fair video is on the way tomorrow!

    • @BrentOzarUnlimited
      @BrentOzarUnlimited 6 дней назад

      @@ErikDarlingData Whew! Thanks sir. I'm still sure you'll get it working, but at least I feel better that you had to deal with that particular query, heh.

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      I think you'll like it. There are threats of physical violence against Microsoft (in Minecraft).

  • @stephenlawrenson2380
    @stephenlawrenson2380 6 дней назад

    Exec dbo.MicrosoftCertifiedMaster - you are a cruel person, Mr Darling 😂😂😂

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      I should have had one, but no one would give me 20k and a month off work 😭😭😭

    • @stephenlawrenson2380
      @stephenlawrenson2380 6 дней назад

      @@ErikDarlingData the boss spent the training budget on himself then 😂

  • @plancktime9750
    @plancktime9750 6 дней назад

    As i always suspected, you're way smarter than Brent

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      According to Beer Gut Magazine, I'm only younger and better looking.

  • @jepedregosa
    @jepedregosa 6 дней назад

    from what I learned, the reason why it says 13.x seconds is because it is the sum of the number of seconds for each thread running in parallel. please correct me if im wrong

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      I think you're talking about for the Gather Streams thing? The problem is that the operator time there is inconsistent with the actual query execution time.

  • @mattcargile
    @mattcargile 7 дней назад

    I want your datalength!

  • @RomanPeralta
    @RomanPeralta 7 дней назад

    Long videos are like second breakfast-there's always more than you expect!

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      I hope this is a good thing. Second breakfast sounds like first nap.

  • @douglascoats7081
    @douglascoats7081 7 дней назад

    I dont have an issue with your length. You are long enough lol seriously though who is actually complaining about 15 minute videos?

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      It's the internet people complain about everything

  • @TZH474
    @TZH474 7 дней назад

    Is that “live Elvis entertainment “?

  • @clerincg
    @clerincg 7 дней назад

    Don't shorten your videos too much or I'll have to shorten my lunch break accordingly 😁 Erik, are you ever concerned the Unicode strings take twice as much storage as non-Unicode? If you will never (well, never say never, right??) have Unicode characters, is it worth the storage overhead?

    • @ErikDarlingData
      @ErikDarlingData 7 дней назад

      No, I honestly don't care about that. It falls into the category of 32 bit problems, like index fragmentation, page splits, and other goofy memes from the bad old days.

  • @jackiecooper9439
    @jackiecooper9439 7 дней назад

    When making a dynamic SQL string using multiple NVARCHAR(MAX) variables why does it sometimes not take more than 4K characters? Did any1 else face this issue here? On stack overflow I read it's due to 8K page size. But it happens only on some complex dynamic queries and I am not able to recreate it in simple scenarios.

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      Well, the SO explanation is wrong. Leave that out of your brain. I think you're confusing what can be put into a string vs what can be printed from a string. PRINT statements have an 8000 byte (not character) maximum, so printing out unicode (nvarchar) strings with standard ASCII characters can only display the first 4000 (each character being two bytes instead of one). If you use print and substring, you can get deeper into longer strings. You can run into situations where using + to concatenate strings that don't have an explicitly declared length can suffer from implicit conversions from max to shorter byte lengths. That's why to be safe I end up explicitly casting shorter strings that I'm concatenating in to nvarchar max.

    • @jackiecooper9439
      @jackiecooper9439 6 дней назад

      @@ErikDarlingData Thanks for replying. The LEN itself is 4k charcters. Eg: I have two NVARCHAR (MAX) variables @Sql1 and @Sql2 each are individually built using multiple sting concatenations using '+'. The final SQL string to be executed is built as follows: Declare @FinalSql NVARCHAR(max) Set @FinalSql = @Sql1 + @Sql2 Now the LEN( @Sql1) is 4k. So the query has lost all the characters after 4k characters, thus giving me an apt syntax error. I use PRINT CAST (@FinalSql as NTEXT) to print everything and @Sql1 portion is indeed cut off at precisely 4k characters.

    • @jackiecooper9439
      @jackiecooper9439 6 дней назад

      @@ErikDarlingData So I guess the culprit is concatenations using '+'. Currently I'm tricking by; Set @SQL1 = @Sql1 /*contains the string almost upto 4k characters*/ + -- rest of the concatenations. Now the @Sql1 is correctly formed.

    • @ErikDarlingData
      @ErikDarlingData 6 дней назад

      @@jackiecooper9439 well, I'm not entirely sure based on your description and solution what the problem is, but like I said before, tacking on shorter strings can often result in strange truncation issues. An alternative way to make sure the contents are fully displayed would be something like: SELECT ( SELECT [processing-instruction(_)] = @sql1 FOR XML PATH(''), TYPE );

  • @ntobergta
    @ntobergta 7 дней назад

    It’s about how rounded it is

  • @saadmuhammad2248
    @saadmuhammad2248 7 дней назад

    Hi, how long this 75% discount is available, I am planning to buy this in the 1st week of November, if it is still available at that time. thank you for a generous offer!

  • @johndavison8393
    @johndavison8393 9 дней назад

    :

  • @fpost337
    @fpost337 10 дней назад

    Shorts from Erik. O tempora, o mores!

  • @fpost337
    @fpost337 10 дней назад

    I like it!

  • @jackiecooper9439
    @jackiecooper9439 10 дней назад

    Whats your go to metric when gauging query performance?

  • @thomasfranz8722
    @thomasfranz8722 10 дней назад

    Why is there no sort operator in the Query Plan at 07:55? Of course it uses the Index on the descending reputation first, but it should still need to order by the ascending Id column - except reputation is unique (in the higher ranges), but even with statistics the SQL server can't know/guarantee this, so it would need to sort. A possible reason would, if the ID is the clustered Index and SQL server guarantees, that rows would always be implizit ordered by Reputation DESC + Id ASC, even when the Id is not specified in the CREATE INDEX (the columns of clustered Index will always be included, but I in my opinion unsorted.)

    • @ErikDarlingData
      @ErikDarlingData 10 дней назад

      Because when there’s an equality predicate which guarantees sort ordering. I’m mobile at the moment but if you search my channel for something like index sort you should find videos about it.

  • @clerincg
    @clerincg 10 дней назад

    So covert! Didn't think of you as that sneaky 🤣🤣

  • @douglascoats7081
    @douglascoats7081 10 дней назад

    i do like devious and mischievous things...

    • @ErikDarlingData
      @ErikDarlingData 10 дней назад

      There are entire club basements dedicated to that.

  • @caparn100
    @caparn100 10 дней назад

    Very interesting, what database are you using for your testing? Is it stack exchange?

  • @DanielMaenle
    @DanielMaenle 10 дней назад

    My brain is mush now watching this

  • @chad_baldwin
    @chad_baldwin 11 дней назад

    We went the fancy route and wrote our own code scanner with ScriptDom that gets run as part of the build pipeline. If the developer used anything smelly, we block the PR. Lol

  • @go-live
    @go-live 11 дней назад

    One of my greatest pains in life is the comment from the developer "No I am 100% certain that my code is not causing any blocking because I put NOLOCK hints on all my SELECTs. So it must be something else."

    • @FlaggedStar
      @FlaggedStar 10 дней назад

      Explaining why that is wrong is always a pain. You have to get in to what locks NOLOCK takes and what it respects.

    • @ErikDarlingData
      @ErikDarlingData 10 дней назад

      Very few people are interested in learning these mechanics, yet will argue with you armed with all of their misconceptions. It's a sad state of affairs.

  • @andychamard2412
    @andychamard2412 11 дней назад

    I am going to add this to my toolkit. Thanks!

    • @ErikDarlingData
      @ErikDarlingData 10 дней назад

      Your developers will love you for this 😃

  • @Chompingbits
    @Chompingbits 11 дней назад

    Kronos Quartet Plays. Chanting circle of dudes "String to String!"

  • @philippecloquet812
    @philippecloquet812 11 дней назад

    Hi Erik, I replayed the same queries on my box and I have a different result, the first query (with fetch) took 10 seconds on the first run (4.2M pages read from disk), 2 seconds the next run. The second query with the row_number function was not faster altough batch mode was used. I double checked the execution plans and they are exactly the same as yours. Am I missing something? PS I use PoorMansTSqlFormatter for my formatting 🙂, and thanks for all these unforgettable parties 🥳🥳🥳

    • @ErikDarlingData
      @ErikDarlingData 11 дней назад

      I don't have a quick answer for you here. I'm sure it's possible, but I'm not sure where things differ.