99% Cost Improvement in This SQL - See How It’s Done

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

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

  • @sdmagic
    @sdmagic 5 месяцев назад +1

    You never disappoint! The plan goes liked this: You send and I receive an email -> I click the link and watch the video -> I learn A LOT! Thank you so very much.

    • @DatabaseStar
      @DatabaseStar  5 месяцев назад +1

      Thanks a lot! I'm glad you liked the video.

  • @ThanhNguyen-qw7us
    @ThanhNguyen-qw7us Год назад +3

    Really really good video!!!!! Please make other videos about optimizing queries. It's really close to what's actually needs to be considered when working in the real tasks.

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

      Thanks a lot, I'm glad you enjoyed it!

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

    I did not understand how creating index on a temporary table would improve the query. If this operation is conducted every time this query runs, doesn't it increase the cost?

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

      Good point. Yes it would increase the cost as it’s run each time. If it runs slower overall compared to the original method than it may not help. Otherwise a permanent table could be another way to improve it where the index is kept.

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

    Great demonstration Ben. Very helpful video.

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

    Interesting video. I was just curious to understand how query costs are getting calculated here. If it's not mili second or second - then what this number actually mean?

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

      The Cost number is an arbitrary number, which means it doesn't represent any length of time or anything else like disk reads. It's a calculation that can be used to compare against other plans on the database.

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

    I wish I were able to get that tool you're using for the flow chart but I can't find it in SQL Server (assuming that's where you're doing this).
    Is there ever a case to add multiple columns to an index?

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

      Yeah it's a good visualisation. This was done in MySQL Workbench which is using MySQL. SQL Server Management Studio has a similar visualisation, but it's not quite the same. I plan on creating a video like this using SQL Server so you may find that more useful.
      Adding multiple columns to an index is helpful in some scenarios. One would be if you have an Order By clause with multiple columns, you may want to add those columns to an index as it may improve the performance of the query.

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

    nice video, is there a similar feature (Execution plan and graph representation) in Oracle Database ?

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

      Yes there is. In Oracle SQL Developer, you can see the execution plan, but it's text based and not a chart or image like this one. Other IDEs will have different ways of viewing the plan.

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

      @@DatabaseStar can you please make a video on oracle execution plan how to read it and how know and understand about key improvements?

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

      Sure, good idea!

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

    Great video! Thanks

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

    Great video! Thanks for sharing!

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

    Nice, you made that really easy to understand!

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

      Thanks, I'm glad it was easy to understand!

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

    Very nice and informative, Thank you