Add a user_actions view. This view unions together a bunch of tables to produce an event log of every action taken by a user. Also add a bunch of indexes to make queries on this table efficient. Even though the view is an enormous query combining together about 30 different tables, queries are very efficient as long as every table has `created_at` and `(user_id, created)` indexes.
3.2 KiB
3.2 KiB