~/talk

Table Inheritance in PostgreSQL

Talkat code.talks 2022 · 2022-09-15..09-16· [databases]
links:none on file
slides:none on file

PostgreSQL table inheritance gets applied to Forge of Empires to reduce storage and speed common operations: tests on 1 million rows show disk use falling from ~150MB to ~90MB (about 40% less space), inserts/updates save small amounts but deletes collapse from ~70 ms to 0.2 ms delete for child-row removals, and per-child selects drop from ~570 ms to ~75 ms. Practical downsides: unique constraints not inherited (primary and foreign keys behave per-table), migrations and constraint workarounds are manual.

AI-written summary · about

  1. 0:00Start
  2. 2:45DIFFERENT DESIGNS IN RELATION DBS
  3. 6:02TABLE INHERITANCE
  4. 7:58QUERY EXAMPLES
  5. 12:07TESTING SCENARIO
  6. 19:07DRAWBACKS
  7. 19:44FOREIGN KEY CONSTRAINT
  8. 21:00PRIMARY KEY CONSTRAINT
  9. 22:43UNIQUE CONSTRAINT
  10. 24:13FIRST IMPLEMENTATION
  11. 25:33DB DESIGN CHANGES
  12. 27:40INSIDE THE CODE
  13. 29:34ADDING NEW CHILDREN AND PARENTS
  14. 30:59RECURRENT MANUAL STEP
  15. 31:56OTHER FEATURES
  16. 33:56COMPARISON BETWEEN DESIGNS
  17. 35:29CONCLUSION
  18. 36:43END OF PRESENTATION
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.