Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Map of Amazing Postgres Extensions You Might No...

Map of Amazing Postgres Extensions You Might Not Know About | Claire Giordano | PGDay Chicago 2024

Slides from a Postgres extensions talk I gave at PGDay Chicago 2024. With an awesome mind map for data viz purposes.

Abstract: Postgres extensions are everywhere—and are found in oh so many Postgres deployments. You might even say that PG extensions are the tools that make your Postgres toolbox complete.

But navigating the world of PG extensions can be a challenge. Where do you find all the extensions? Which Postgres extensions can make your life better and save you time? Which ones should you consider using? Can you trust them?

This talk walks you through the set of amazing Postgres extensions I’ve learned about in my ~7 years working in the world of Postgres: what they are, why care, and where to find them. You’ll learn about popular extensions like pg_stat_statements, "super extensions" such as PostGIS and Citus—as well as 25 lesser-known extensions that are quite handy, too.

This talk includes a brief detour into the history of Postgres extensions, plus a glimpse into the future of extensions (spoiler: will they be built with Rust?) By the end of this talk, you’ll have a “map” of the world of amazing Postgres extensions—plus a legend and compass for figuring out which extensions can help you and your application.

Claire Giordano

April 25, 2024
Tweet

More Decks by Claire Giordano

Other Decks in Technology

Transcript

  1. CLAIRE GIORDANO @clairegiordano • @pg_at_msft • @AzureDBPostgres • @citusdata •

    @PosetteConf PGDAY CHICAGO 2024 MAP OF AMAZING POSTGRES YOU MIGHT NOT KNOW ABOUT EXTENSIONS MAP OF AMAZING YOU MIGHT NOT KNOW ABOUT
  2. 4 What is a Postgres extension?  Adds functionality to

    Postgres (hence: “extends” Postgres)  Not a fork  To use—install Postgres & the PG extension(s)  To enable (or disable), get familiar with CREATE EXTENSION ALTER EXTENSION DROP EXTENSION
  3. 5 Search for a good analogy for Postgres Extensions plug

    & play beloved modular building toy
  4. 6 Search for a good analogy for Postgres Extensions can

    you add on specialized tools to Swiss Army Knife? are extensions similar to Apps in an App Store?
  5. 7

  6. 8

  7. To understand what exists, needed “mental map” of different types

    of PG extensions In 1<>1 with Daniel Gustafsson, explored this 1st draft set of “categories” 1. Monitoring 2. Indexing 3. Data types 4. Geospatial 5. Statistical Analysis 6. Distributed Scale 7. Connectors 8. Storage Optimizations
  8. First place I looked for Categories: PGXN.org I found tags!

    Not categories. I could search! Not browse extensions.
  9. Azure Cosmos DB for PostgreSQL has “categories” in docs too

    Citus Data types Full-text search Functions Index types Language Miscellaneous Pgvector PostGIS
  10. Like a dog with a tennis ball I spent wayyyyyy

    too much time trying to come up with “right” set of categories
  11. @[email protected] All models are wrong, but some are useful.” “

    —George Box, statistician Dimitri Fontaine reminded me of this quote
  12. 25 Mind map of Postgres Extensions (by category) pg_cron pgtap

    amcheck pg_partman pgvector postgresml HLL topn postgres_fdw Citus multicorn postgis pgrouting hypopg RUM plv8 orafce pg_stat_statements pg_hint_plan pgSentinel fuzzystrmatch AI / Machine Learning Admin Migration tdigest pg_prewarm pg_surgery @[email protected]
  13. postgres_fdw CONTRIB fdw = “Foreign Data Wrapper” lots and lots

    of foreign data wrappers (just a few listed here) mysql_fdw mongo_fdw postgres_fdw duckdb_fdw tds_fdw oracle_fdw kafka_fdw Connectors CATEGORY mysql_fdw
  14. Citus Distributed PostgreSQL “Postgres at any scale” Sharding Led by

    Microsoft “Super extension” CATEGORY Distributed Scale
  15. pgvector open source vector similarity search has added HNSW as

    new index type HNSW = Hierarchical Navigable Small World (HNSW) CATEGORY AI / Machine Learning Source: Photograph by Claire Giordano from Andy Pavlo’s Keynote at PGConf NYC 2023, titled “What Goes Around Comes Around... and Around...”
  16. pg_cron Created/maintained by Marco Slot CATEGORY Admin “pg_cron: probably the

    best way to schedule jobs within PostgreSQL database” —FatDBA - - vacuum my table every night at 3am (GMT) SELECT cron.schedule( '0 3 * * *’, 'VACUUM my_table’ ); - - call a procedure every minute SELECT cron.schedule('process-new-events’, '* * * * *', 'CALL process_new_events()');
  17. RUM more powerful version of GIN index for text search

    (or your own custom types) stores additional info per entry, e.g. timestamp CATEGORY Index
  18. CATEGORY Index hypopg hypothetical indexing try out an index for

    free: doesn’t cost CPU, disk, resources visible to query planner helps you find an index for slow queries
  19. pg_hint_plan “ —Rob Treat, statistician It’s an excellent learning tool,

    really good for deep dive performance work. Why? Because it gives you ability to pick and choose between different indexes—and get the execution plan without having to rebuild those indexes... The larger the data set the more valuable it is.” CATEGORY Performance
  20. pg_hint_plan “ —Rob Treat, statistician It’s an excellent learning tool,

    really good for deep dive performance work. Why? Because it gives you ability to pick and choose between different indexes—and get the execution plan without having to rebuild those indexes... The larger the data set the more valuable it is.” CATEGORY Performance EP10: “My Journey into Postgres Monitoring” LISTEN TO THE PODCAST
  21. pgsentinel a way to get what’s going on in the

    database over time you can look at “right now” with pg_stat_activity, but maybe something important happened 5 minutes ago? or maybe you need statistics about “what’s been happening in my database” created/maintained by Bertrand Drouvot CATEGORY Performance
  22. plv8 procedural language lets you run JavaScript code stored procedures,

    triggers plv8 documentation link from Jerry Sievert Language CATEGORY https://plv8.github.io/
  23. orafce makes it easier to migrate from Oracle to Postgres

    functions, data types... mysql_fdw Migration CATEGORY
  24. “ —Daniel Gustafsson, Postgres hacker at Microsoft The TAP in

    pgTAP stands for “test anything protocol.” pgTAP enables you to write unit tests for your database—for objects, tables, & views. Developers will tell you it’s really really cool.” pgTAP CATEGORY Admin
  25. pg_prewarm CONTRIB useful to put pages back in cache after

    restarting Postgres maybe should have been in “Performance” category? Admin CATEGORY
  26. fuzzystrmatch CONTRIB ”fuzzy string match” Source: pganalyze blog post: Similarity

    in Postgres and Rails using Trigrams Text CATEGORY pg_trgm CONTRIB “trigram”
  27. 59 4 common sources for Postgres extensions... +1 to Christoph

    Berg, Devrim Gündüz, David Wheeler, & all PG extension creators! RPM & Debian “Contrib” (pre-bundled) RPM, Debian, etc. package PGXN Client Cloud provider (if managed service)
  28. PGXN v2 improvement project community project led by David Wheeler

    from Tembo 60 Want to get involved or provide input? Future PGXN-v2 Architecture Diagram (Apr 2024) Source: David Wheeler of Tembo: https://gist.github.com/theory/1de9633f57976e778b46b013867c3147 pgtreats.info/slack-invite Join #extensions channel on Postgres Slack
  29. 62 Source: cs.cmu.edu. Copyright 1984 ACM. Originally published in Communications

    of the ACM, August 1984, Volume 27, Number 8. Copy by permission of the Association of Computing Machinery.
  30. PGRX = Platform for building Rust extensions Created by Eric

    Ridge of ZomboDB... Used by 62 repos so far 2.7K stars
  31. Not only do developers love Rust—extensions that are built in

    Rust will benefit users too Source: Jelte Fennema talk “Postgres without SQL: Natural language queries using GPT-3 & Rust” at Citus Con: An Event for Postgres 2023. Published on YouTube.
  32. People to thank for inspiration & reviews Daniel Gustafsson David

    Wheeler Devrim Gündüz Dimitri Fontaine Jelte Fennema-Nio Jerry Sievert Marco Slot Melanie Plageman Nik Larin Robert Treat Samay Sharma Teresa Giacomini Thomas Munro
  33. Have you heard of this podcast for developers who love

    Postgres?  Monthly  14+ episodes  A-ma-zing guests aka.ms/PathToCitusCon Hosted by Claire Giordano
  34. with topics like....  Becoming expert in PostgreSQL  From

    dev to Postgres specialist  Journey into Performance benchmarking  My Journey into Postgres monitoring  How I got started as a developer  Why people care about PostGIS aka.ms/PathToCitusCon Hosted by Claire Giordano