~/talk

Simple and Awesome Database Tricks

Talkat RubyConf AU 2017 · on Friday, 2017-02-10· [databases]
slides:none on file

Concrete, hands‑on Postgres techniques with examples: using EXPLAIN ANALYZE to find a table scan on a 10,000‑row test table and cut runtime nearly in half with indexes, enabling pg_stat_statements (it stores ~5,000 recent queries), generating time series with generate_series to plot flights (81 flights at 04:00 on 1999‑06‑01), jsonb and range types, uuid‑ossp, PostGIS spatial queries, Scenic views and functions, and foreign data wrappers — shows commands, migrations, and results.

AI-written summary · about

  1. 0:00DATABASE TRICKS Simple and Awesome
  2. 0:18@BARRETTCLARK
  3. 1:05DATABASE TOOLS
  4. 4:55DIFFERENT ENVIRONMENTS ARE DIFFERENT
  5. 5:36EXTENSION?!
  6. 5:54ActiveRecord migration?
  7. 6:06edit postgres config postgresql.conf
  8. 9:50DATA TYPES
  9. 10:06API PAYLOADS
  10. 10:23STORE THE PAYLOAD!!
  11. 12:57FOR MORE ON RANGE TYPES
  12. 14:17DATA INTEGRITY Benefits
  13. 14:47PREMATURE OPTIMIZATION? YMMV
  14. 15:05WORKING WITH DATA
  15. 15:50COMMON TABLE EXPRESSION AKA: CTE OR WITH QUERY
  16. 19:08SCENIC GEM
  17. 22:42MEDIAN
  18. 23:17STRUCTURE AND EXTENSIONS
  19. 24:22ETL Extract, Transform. Load
  20. 24:57BACKUP & RESTORE
  21. 25:273RD PARTY FUNCTIONS
  22. 25:49INSTALLATION
  23. 29:293 CLOSEST AIRPORTS San Francisco
  24. 30:21MAPS
  25. 32:11MULTI-TENANT APP
  26. 32:22BONUS TIP!!
  27. 33:19DATA VISUALIZATION TOOLKIT
~/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.