Postgres Explain Explained - How Databases Prepare Optimal Query Plans to Execute SQL

Sdílet
Vložit
  • čas přidán 16. 03. 2021
  • In This video I'll go through how Explain works in PostgreSQL, explain is the command that you add to the beginning of your SQL to return details about how the database is going to execute the statement.
    🎙️Listen to the Backend Engineering Podcast
    husseinnasser.com/podcast
    🏭 Backend Engineering Videos
    backend.husseinnasser.com
    💾 Database Engineering Videos
    • Database Engineering
    🏰 Load Balancing and Proxies Videos
    • Proxies
    🏛️ Software Archtiecture Videos
    • Software Architecture
    📩 Messaging Systems
    • Message Queues & PubSu...
    Become a Member
    / @hnasr
    Support me on PayPal
    bit.ly/33ENps4
    Join our Thriving Backend Community on Discord
    / discord
    Stay Awesome,
    Hussein
  • Věda a technologie

Komentáře • 22

  • @hnasr
    @hnasr  Před 3 lety +1

    Learn the fundamentals of database systems to understand and build performant backend apps
    Check out my udemy Introduction to Database Engineering
    husseinnasser.com/courses

  • @ramymousa4189
    @ramymousa4189 Před 3 lety +15

    Thank you! would be great to post an extended version of it with details about planning JOINS and calculations.

  • @homeygdoggydogg
    @homeygdoggydogg Před 3 lety +8

    excellent video. Although according to the documentation the 'cost' isn't actually milliseconds but 'aribtrary unit of disk fetches'.

    • @hnasr
      @hnasr  Před 3 lety

      Thanks for spotting that!

    • @homeygdoggydogg
      @homeygdoggydogg Před 3 lety

      @@hnasr happy to be of some help.. and really hoping for a more detailed follow up to this video!

  • @toshn4151
    @toshn4151 Před 3 lety

    This is fantastic, thanks! More on this topic would be wonderful.

  • @jotalearn
    @jotalearn Před 9 měsíci

    Loved this, thanks!!

  • @thechhavibansal
    @thechhavibansal Před 3 lety +1

    a video on simple and extended flow in postgreSQL please...
    your videos are great, 🔥

  • @hackwithharsha5228
    @hackwithharsha5228 Před 3 lety

    Thank you,, any idea why the rows aren’t matching when you do “order by id” and “order by name” ?

  • @ketaniralepatil4680
    @ketaniralepatil4680 Před 3 lety +2

    Sir can you make a video about graph databases ?

  • @rahuls331
    @rahuls331 Před 3 měsíci

    @hnasr Where is the video for the analyze command? Thank you!

  • @JenilCalcuttawala
    @JenilCalcuttawala Před 3 lety +3

    Excellent video Hussain as usual. But @3:04 you mentioned that at times you don't need to display the exact count (i.e. Instagram likes) and we should use explain command returned analysis. But how do we do that?

    • @rabeeamustafa2228
      @rabeeamustafa2228 Před 3 lety

      +1

    • @hnasr
      @hnasr  Před 3 lety +4

      Sure thing! From your client you execute your SQL but add an “Explain (format json) yoursql” and you basically get the stats explain returned to your app. You then parse for the estimated count, returning JSON makes it easy
      Here is a video I made on this topic czcams.com/video/8xKS7QQKgzk/video.html

    • @JenilCalcuttawala
      @JenilCalcuttawala Před 3 lety

      @@hnasr You're the boss! Pretty straightforward. Wait,,, how did I miss your video. :-/

  • @HM_Milan
    @HM_Milan Před 3 lety

    Can you make video about what is the best Distributed database and why that.how effect backend engineers by distributed data base

  • @fashionvella730
    @fashionvella730 Před 5 měsíci

    I watch your videos like I am watching Netflix 😀

  • @omarelkhatib150
    @omarelkhatib150 Před 9 měsíci +1

    The cost is relative based on settings you specify in cfg file. They are arbitrary numbers, you don't care about those numbers as it says I am X relatively to Y, and those costs change from machine to machine.

    • @yan-amar
      @yan-amar Před 5 měsíci

      yeah definitely not milliseconds

  • @toadtws
    @toadtws Před 5 měsíci

    Does anybody have a pointer to info on the company that overflowed their primary key as described @7:25? Was that Parler?

  • @fahimalif4068
    @fahimalif4068 Před 3 lety +2

    I think new video coming soon on instagram down

  • @loneshaan8531
    @loneshaan8531 Před 3 lety +1

    First view