SQL indexing best practices | How to make your database FASTER!

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

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

  • @drugofsweetness
    @drugofsweetness 6 месяцев назад +12

    "When in doubt, explain" is what i loved about this video.

  • @chleba50
    @chleba50 21 день назад +2

    This video helped me a lot to understand SQL indexing as a beginner, thanks.

  • @TakamuraOG
    @TakamuraOG Месяц назад +2

    Dude I appreciate this video, I had two days to try to understand via Copilot, but I was able to catch, that the index sped up the analysis. I thought that I would have another column with numbers, and I needed to use those numbers to filter the search. Now is clear how it works. Thanks a lot!!!

  • @jeswer9
    @jeswer9 Год назад +9

    Someone that talks sense. Great info!

  • @electrolyteorb
    @electrolyteorb Год назад +3

    Great video 🎉 you are just teaching Not only for CRDB but Sql dbs in general 👍

  • @gregmaier5784
    @gregmaier5784 3 месяца назад +1

    Beautifully explained, thank you!

  • @marktaft
    @marktaft Месяц назад

    Underrated video. Thank you.

  • @MagicOfDark
    @MagicOfDark Год назад +12

    I had table without index took 18 hours to run, with index took like 6 minutes. Table had millions of entries. Also made some changes to my code, but that only shaved like 1-2 hours off.

    • @Shujahaidergaming
      @Shujahaidergaming 8 месяцев назад +1

      How it happens . It a alot of margin 6 hours and 6 minutes.
      How much data in your table ?

    • @ECHQVQID
      @ECHQVQID 15 дней назад +1

      ​@@ShujahaidergamingDoesn's matter with the right index, see it like a cake, without a map you will scan the whole cake, but with the right index, you categorize the the cake with color, taste, volume etc, if the sql statement had a where clause of the the color and taste in it, it only has a small piecie of that cake, and that was the end result so the cake was 100gb but the piece 10 kb, with the right mapping it will only scan the small piece

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

    Thanks! This was a nice enlightening explanation!

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

    Wow....Ok so I work int he Oracle and SQL DB's a;; the time and yes moving big data and queries this gives more clarity on how to manage thisngs.

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

    Very helpful, thank you!

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

    thank you very much, very helpful

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

    Thanks !

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

    Would it not have been more efficient to create a separate table for the city column with additional information about the city such as region and country and reference that by Id and then index based on that instead and additionally have less redundant data or how?

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

      correct. for data that repeat, what you suggested is the right solution. however, this is an example situation and they are trying to explain how indices are used.

  • @abhay6276
    @abhay6276 7 месяцев назад +1

    You didn't mention which index you created ? Clustered or non Clustered?😊

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

    Hello man,
    God bless your efforts.
    I have a simple enquiry as a new sql learner.
    How does the term b-tree relate to the index function in sql?
    Thanks for taking care of this.

    • @tomatte99
      @tomatte99 2 месяца назад

      I think the indexing is for the database be able to do a binary search, that is probably done using a binary search tree, that is a type of b-tree

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

    How many indexes should one add? And how do you know which columns to choose?

    • @MatheusLB2009
      @MatheusLB2009 6 месяцев назад +1

      Maybe too late but indexes have to be unique (otherwise there is conflict) and preferably small as he said in the video. And if there is none, having a table mostly sorted by a specific column, like DateTime, naturally speeds up the query

  • @chrisder1814
    @chrisder1814 3 месяца назад

    hello I would like to do automation with tools of our codes in my WordPress database but I don't know if these ideas are good and feasible, could you help me understand

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

    Hi Sir, I have a table that consist of 16mil record and it will increase, weekly basis. to retrieve this table in Powerbi it is taking more time get this data from large SQL table. can you suggest any changes on the existing table ? current table doesn't have any indexes.

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

      Alter the table syntax an add the index

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

    Cool

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

    oooooooor create a JSON with the cached results :D

  • @DavidYoo-m7z
    @DavidYoo-m7z Год назад +2

    Love this video HATE the name cockroach, disgusting

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

      I felt the same but honestly aren't they just insects like every other? I feel sad for the little critters now lol

    • @DavidYoo-m7z
      @DavidYoo-m7z Год назад +1

      @@rainymornings Appreciate your sentiment, still HATE roaches.

  • @samcheung3511
    @samcheung3511 3 месяца назад

    Thanks🥲