~/talk

Multi-table Full Text Search with Postgres

Talkat RailsConf 2016 · 2016-05-04..05-06· [ruby-on-rails, databases]
slides:none on file

A real feature evolves from LIKE to Postgres full text search across multiple tables using database views and materialized views; the build uses the Textacular gem for tsquery helpers and Scenic to manage view SQL in migrations. Indexing choices matter — GIN is ~3× faster to query but larger and slower to build than GIST — and raw multi-table queries are an order of magnitude slower than querying a materialized view, which yields large practical speedups and avoids external search services.

AI-written summary · about

  1. 0:00Multi-table Full Text Search Postgres
  2. 1:51I'm going to talk to you about
  3. 2:31Materialized Views
  4. 2:43Other Options
  5. 3:51Exact substrings
  6. 4:54Search by Author's name
  7. 5:51Poor results
  8. 6:17natural language searching
  9. 8:28That's a lot of SQL.
  10. 9:02Stored in the Database
  11. 9:28Multi- source
  12. 11:45Will it work with full text search?
  13. 12:01Takes care of the Full Text Search portions of queries
  14. 14:20CREATE Migration
  15. 14:50How resistant to change is it?
  16. 15:39UPDATE Migration
  17. 16:55Can't be dumped to db/schema.rb
  18. 17:16Scenic
  19. 20:14Performance
  20. 20:33Views can't be indexed
  21. 20:44btree
  22. 23:11Pre-populate the results of the view
  23. 23:35Query against result set
  24. 24:34What about pre-built solutions?
  25. 25:33development
  26. 25:54Needs to be faked in tests
  27. 26:35Remove a data concern from your database
  28. 26:56that doesn't require any new dependencies
~/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.