Fix PostgreSQL sometimes using table scans for queries against the `event_search` table, taking a long time and a large amount of IO.