Optimize Your SQL Queries | Postgres Edition

Поділитися
Вставка
  • Опубліковано 1 сер 2024
  • Easy way you can analyze and optimize your SQL queries to get the best performance out of them.
    Reference: thoughtbot.com/blog/reading-a...
    🥹 If you found this helpful, follow me online here:
    ✍️ Blog / irtizahafiz
    👨‍💻 Website irtizahafiz.com
    📲 Instagram / irtiza.hafiz
    0:00 Agenda
    01:15 Difference between EXPLAIN & EXPLAIN ANALYZE
    02:35 How count of returned rows affect performance
    04:15 How to monitor index usage
    10:30 Aggregation queries using indexes
    13:37 Information about JOIN algorithms
    18:15 ORDER BY using Index forward and backward
    20:56 How to read query plans
    22:10 Outro
    #database #mysql #postgres

КОМЕНТАРІ • 11

  • @xanthus1
    @xanthus1 Рік тому +1

    Just wanted to say thanks for this video! This was a great step by step breakdown and analysis.

    • @irtizahafiz
      @irtizahafiz  8 місяців тому

      Thank you for taking the time to leave a comment. Glad you found it useful.

  • @user-ct2mp1xt4f
    @user-ct2mp1xt4f 2 місяці тому

    thank you it was very clear

  • @DanielSposito
    @DanielSposito Рік тому

    All of your videos are excellent. Thank you for the clear explanations and detailed examples. I hope you continue to create more videos for your channel!

    • @irtizahafiz
      @irtizahafiz  8 місяців тому

      Glad you found it helpful! Cheers!

  • @luanlucas8605
    @luanlucas8605 Рік тому

    Hi. Found your channel today and subscribed. Pretty good content here. Keep it up :D

  • @robertczaja176
    @robertczaja176 3 місяці тому

    great video thanks a lot!

  • @Rashidulhasan777
    @Rashidulhasan777 Рік тому

    Near 17:40, I think the volume table doesn’t have only one row. I think it decided to sequentially scan the volume table for each volume.volume_id will then match book.volume_id with each volume.volume_id. And for matching purposes, it is doing index scan as there is an index for book.volume_id. Sorry, I might be wrong. I didn’t understand how DBMS decided which table it will do the sequential scan first? Thanks for your video!

    • @irtizahafiz
      @irtizahafiz  Рік тому

      Hi! Thank you for explaining.
      The link I have in the description should give you a better understanding of how to read these query plans. I was just trying to explain the tool, rather than go into the details of how to read them.