Postgres scales … when you do this!

Поділитися
Вставка
  • Опубліковано 23 лип 2024
  • Partitioning Tables can greatly improve the efficiency of your Postgres queries by drastically reducing the size of the result set being processed. In this video, Jon Meyers demonstrates how to refactor a giant multi-tenant table into much smaller, individual partitions.
    🐘 Partitioning tables: supabase.com/docs/guides/data...
    Table partitioning in Postgres is a powerful database feature that allows large tables to be divided into smaller, more manageable pieces called partitions. Each partition can be accessed and managed independently, improving query performance and simplifying maintenance. Partitions can be created based on various criteria, such as range, list, or hash, enabling efficient organization of data. By filtering queries to search within specific partitions, database operations become faster and more efficient. This technique is particularly useful for handling large datasets, optimizing resource usage, and enhancing overall database performance.
    00:00 When you need Table Partitions
    02:19 Creating a Partitioned Table by List of values
    03:39 Creating Partitions for each unique value
    04:42 Querying partitioned tables
    06:21 Maintaining partitions as data changes
    08:36 Querying across multiple partitions
    09:18 Combining Indexes with Partitioned Tables
    💻 Videos to watch next:
    ▶ Make your queries 43,240x faster: • Make your queries 43,2...
    ▶ The FASTEST possible way to query data: • The FASTEST possible w...
    ▶ Simple trick to make your queries WAY more efficient: • Simple trick to make y...
    👇 Learn more about Supabase 👇
    🕸 Website: supabase.com/
    🏁 Get started: app.supabase.com/
    📄 Docs: supabase.com/docs
    🔔 Subscribe for more tutorials and feature updates from Supabase: / @supabase
    📱 Connect with Us:
    🐙 Github: www.github.com/supabase
    💬 Discord: www.discord.supabase.com/
    🐦 Twitter: / supabase
    ▶ Instagram (follow for memes): / supabasecom
    ABOUT SUPABASE:
    Supabase is the open source Firebase alternative. Supabase provides a full Postgres database for every project with pgvector, backups, realtime, and more. Add and manage email and password, passwordless, OAuth, and mobile logins to your project through a suite of identity providers and APIs.
    Build in a weekend, scale to millions.
    #Supabase #AppDevelopment #RealtimeApps #DeveloperTools
  • Наука та технологія

КОМЕНТАРІ • 32

  • @wembleyleach
    @wembleyleach 26 днів тому +20

    Yes! Please do a video on partitioning a table with no down time. This recent Postgres series of content has been a goldmine of knowledge that’s either hidden in the docs, or locked in somebody’s head somewhere because they got the experience but never shared it.

    • @Innesb
      @Innesb 26 днів тому

      It’s worth bearing in mind that it’s not feasible for Supabase to document or teach us about all of these features. They are not Supabase features; they are PostgreSQL features, and PostgreSQL has been around for decades. It’s all documented on the PostgreSQL site, with thousands of tutorials all over the Internet.

    • @JonMeyers
      @JonMeyers 8 днів тому

      Excellent! Will add it to the list! 👍

  • @FTheohu
    @FTheohu 25 днів тому +6

    I hope this series never ends.

    • @JonMeyers
      @JonMeyers 8 днів тому

      Thanks! Glad you’re enjoying the series! 🙌

  • @MrZiyak99
    @MrZiyak99 25 днів тому +4

    you're an underated content creator have learnt a ton about relational dbs from your vids!

    • @JonMeyers
      @JonMeyers 8 днів тому

      Glad to hear that! What would you like to see next?

  • @luisandrade1291
    @luisandrade1291 25 днів тому +4

    Please make a video showing how to use pg_partman, every SaaS app would use partitioning if it’s automated.

    • @JonMeyers
      @JonMeyers 8 днів тому

      Will add it to the list! 👍

  • @mrrolandlawrence
    @mrrolandlawrence 26 днів тому +2

    table partitioning in postgres is a superpower! handy for datawarehouses too.

    • @JonMeyers
      @JonMeyers 8 днів тому +1

      Totally! Surprisingly easy to implement for how much this can help the performance of your database!

  • @joedoethe3rd
    @joedoethe3rd 26 днів тому +1

    Very helpful! Thank you

    • @JonMeyers
      @JonMeyers 8 днів тому

      Glad to hear it! 🙌

  • @tristdrum
    @tristdrum 25 днів тому +1

    Absolutely brilliant video! So helpful! Definitely going to do this in my Supabase project and am so keen to check out Partman (video on that please!)
    And would love to see how to do it without downtime too!

    • @JonMeyers
      @JonMeyers 8 днів тому

      Awesome! Will add both of those to the list 👍

  • @takeshikriang
    @takeshikriang 19 днів тому +1

    The MANGOS LOL

    • @JonMeyers
      @JonMeyers 8 днів тому

      The best companies!

  • @eliuddyn
    @eliuddyn 25 днів тому +2

    Amazing 🔥 I like Supabase 🔥🔥

    • @JonMeyers
      @JonMeyers 8 днів тому

      Same! Glad you enjoyed the video! 🙌

  • @markhorley
    @markhorley 26 днів тому +1

    Yes… please do a video on partitions and spend a little time explaining how we would use the api call in the likes of Flutterflow.

    • @JonMeyers
      @JonMeyers 8 днів тому

      Will add it to the list 👍

  • @thibaultbarolat-massole7190
    @thibaultbarolat-massole7190 25 днів тому +1

    When would you recommend to use either index or partition?
    Another great video by the way 😉

    • @JonMeyers
      @JonMeyers 8 днів тому

      Thanks! Glad you enjoyed it!
      I would say reach for an index pretty early, and then look at partitioning when your indexes slow down, assuming you have easily partitionable data 👍

  • @fabien8876
    @fabien8876 20 днів тому +1

    How do you update in live your partitions when you have new data (in your people table for example here)?

    • @JonMeyers
      @JonMeyers 8 днів тому

      You can either create a catch-all partition as “default” or use an extension like pg_partman

  • @rahul_ji21
    @rahul_ji21 25 днів тому +1

    and what about the referenced tables? do they also get automatically partitioned or not

    • @JonMeyers
      @JonMeyers 8 днів тому

      They do not get automatically partitioned. Usually the referenced table does not grow at the same rate, but you could also partition that table if it gets too big 👍

    • @rahul_ji21
      @rahul_ji21 8 днів тому

      @@JonMeyers then why dont u guys add this feature where it can partition the referenced table or automatice partition ?
      and yes i saw pgpartman but theres no tutorial or anything on how to use it properly like you do (yes i am a noob programer )

  • @leetkhan
    @leetkhan 22 дні тому

    Postgres 1
    Supabase 0

    • @JonMeyers
      @JonMeyers 8 днів тому

      Not sure what that means, but every point for Postgres is also a point for Supabase 🤝