Designing for Document Databases in PostgreSQL
summary
DocumentDB is built as a PostgreSQL extension that removes SQL text translation by using the planner hook to feed aggregation pipelines directly to Postgres, achieves 50% improvement on simple scans, stores documents as BSON storage to avoid transcoding, and implements wildcard, multi-valued indexes on a RUM-backed GIN operator class. Planner and RelPathlist hooks eliminate redundant runtime checks (index 66 ms vs 30 s reduced to 136 ms), TTL uses pg_cron, and the extension-path preserves PostgreSQL features like unique constraints and ORDER BY.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:28What are Document DBs
- 4:45Building Queries
- 8:57Indexing & Query
- 14:05Expressing Filters
- 22:00Removing Redundant Clauses
- 24:32Performance (JSONB vs BSON)
related talks
04mGetting Started with DocumentDB and Open Source
01h 00mThe Modern Database Debate: Documents, Tables, or Documents in Tables?
36mTwisting PostgreSQL into a Document Db and Event Store
42mPostgreSQL Tips & Tricks For App Devs
48mData Horizons With Postgres
49mSELECT 'amazing features' FROM "postgresql"
44mPostgreSQL in Django 1.8
33mPostgres, the Best Tool You're Already Using
