Watch Brent Tune Queries - SQLSaturday Oslo

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024

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

  • @Randomvideofanatic
    @Randomvideofanatic 3 года назад +20

    There are very few people who could make query tuning enjoyable and entertaining... you, my friend, are one of them! Thank you so much for the information and providing it in an easily memorable way.

  • @killo4life
    @killo4life Год назад +1

    So enjoyable to watch omg I was tuned in for the entire video understanding everything 100%. You have a wonderful gift

  • @Amy-ve3ke
    @Amy-ve3ke 2 года назад +1

    Quickest video I’ve watched in one hour ?! Can’t believe how much I enjoyed this

  • @montro2220
    @montro2220 10 месяцев назад +1

    Very good video, I love it presenters say that they are terrible at presenting (me being one of them) and they make the best presentations 😆

  • @georgekopadze791
    @georgekopadze791 9 месяцев назад

    You are really good presenter and explain clearly what you want us to understand. Well done, I appreciate your effort and please keep doing. Especially advanced topics: optimization, sharding, indexes and etc. thank you

    • @BrentOzarUnlimited
      @BrentOzarUnlimited  9 месяцев назад +1

      Thank you very much! You'll enjoy my training classes where I cover those advanced topics. Go to BrentOzar.com and click Training at the top of the page.

  • @informationtechnology6001
    @informationtechnology6001 2 года назад +1

    Really nice rep I did not feel boring thank you so much and hope to see new videos

    • @BrentOzarUnlimited
      @BrentOzarUnlimited  2 года назад +1

      Sure, check out my channel. I have several new videos a week. Cheers!

  • @Bill-et5sk
    @Bill-et5sk 3 месяца назад

    So good I watched it twice.

  • @danielcraig9349
    @danielcraig9349 Год назад +2

    Very helpful video, though the sound effects and talk of weed over my speakers at work was less than professional..lol

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

      Goodness! Best to stay clear of my other videos, then. I'm not boring, for sure, heh.

  • @ZafarIssadeen
    @ZafarIssadeen 3 года назад +1

    You’ve got a great Liam Neeson impression going!

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

    Thank you for this
    I'm being destroyed by an app at work and this has given me a lot of things to try

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

    You’re great…Learned a lot today!

  • @devarakondasankararao3802
    @devarakondasankararao3802 11 месяцев назад

    The great video sir , thank you

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

    Super helpful, thank you!

  • @function888
    @function888 6 месяцев назад

    Thank you again, that was wonderful to watch!! BTW, can we get the SP to complete in less than 29 seconds on this hardware??

    • @BrentOzarUnlimited
      @BrentOzarUnlimited  6 месяцев назад

      Check out my Mastering Query Tuning class where you can learn techniques to help.

  • @titusm9837
    @titusm9837 9 месяцев назад

    Soooo what was the right answer?:)))) option recompile? so at least for other locations it would work fast?

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

    Excellent

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

    "I have 5 fingers on this hand and 5 fingers on that hand" - that's suprising)

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

    Please review your procedure, many thanks.

  • @user-zf6sl1lv1c
    @user-zf6sl1lv1c 3 года назад

    Thanks!

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

    You are lovely :)

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

    Skeet Skeet...im sorry i couldnt help myself :P

  • @coreymagin
    @coreymagin 3 года назад

    I love you man.

  • @Ulmenos
    @Ulmenos 9 месяцев назад

    soooo are we unable to do anything to statistics to improve the estimates?

    • @BrentOzarUnlimited
      @BrentOzarUnlimited  9 месяцев назад

      We have a whole class on that! Check out the free Statistics class on our RUclips channel.

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

    That clippy voice... 😂😂

  • @andrewp7497
    @andrewp7497 3 года назад +5

    So no solution!....emmmm O

    • @peterlucas5634
      @peterlucas5634 3 года назад +1

      I think the query was designed to be horrible. There are lots of solutions though, my attempt is below.
      CREATE OR ALTER PROC dbo.rpt_TopUsers_ByLocation
      @Location NVARCHAR(100),
      @StartDate DATE,
      @EndDate DATE
      AS
      BEGIN
      create table #Score (UserID int primary key clustered, PostScore int )
      insert into #Score(UserID, PostScore)
      SELECT
      u.Id,
      SUM(isnull(p.Score, 0)) AS PostsScore
      FROM dbo.Users u
      LEFT OUTER JOIN dbo.Posts p ON u.Id = p.OwnerUserId AND p.CreationDate BETWEEN @StartDate AND @EndDate
      WHERE
      u.Location = @Location
      GROUP BY
      u.Id
      select
      u.Id,
      u.DisplayName,
      u.AboutMe,
      s.PostScore,
      SUM(c.Score) AS CommentsScore
      from
      dbo.Users u
      join #Score s on u.Id = s.UserID
      left join dbo.Comments c ON u.Id = c.UserId AND c.CreationDate BETWEEN @StartDate AND @EndDate
      group by
      u.Id,
      u.DisplayName,
      u.AboutMe,
      s.PostScore
      order by
      s.PostScore desc
      END
      GO

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

    wouldn't it be better to create a stats table where the counts are kept updated, instead of calculating it every time through this query?

    • @BrentOzarUnlimited
      @BrentOzarUnlimited  Год назад +1

      I'll rephrase your question and see if I understand right: "If I have a slow query, wouldn't it be better to add new tables with the results, keep the results up to date, and then query those new tables instead?"

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

      Yes. Although I am totally intrigued by this demo and would try out the same on my sandbox soon.

  • @justsidu
    @justsidu 10 месяцев назад +1

    This video could've been 10minutes. Needs a performance optimization

    • @BrentOzarUnlimited
      @BrentOzarUnlimited  10 месяцев назад

      By all means, feel free to release your own! I'd love to see it.

  • @ZakirHossain-mc1cy
    @ZakirHossain-mc1cy Год назад

    I can't remember that I have ever enjoyed any video on such critical issue