search: add recent_searches table to postgres, add incoming queries to it
Created by: ijt
This is progress towards #2879 (closed).
This PR is a logical unit that will most likely be useful not just for evaluating nested query performance but also for understanding the performance and typical usage of search generally.
The next step on #2879 (closed) will be to add an endpoint that generates a report comparing times for typical searches with and without nested querying enabled. I'll add that in a separate PR.