Every search just times out. Postres logging for queries longer than 5 seconds shows a 76 second and 5x second query after a search:
2019-09-12 20:05:52 UTC LOG: duration: 76023.803 ms statement: SELECT count(*) AS count_1
FROM (SELECT core__media_entries.id AS core__media_entries_id, core__media_entries.public_id AS core__media_entries_public_id, core__media_entries.remote AS core__media_entries_remote, core__media_entries.actor AS core__media_entries_actor, core__media_entries.title AS core__media_entries_title, core__media_entries.slug AS core__media_entries_slug, core__media_entries.description AS core__media_entries_description, core__media_entries.media_type AS core__media_entries_media_type, core__media_entries.state AS core__media_entries_state, core__media_entries.license AS core__media_entries_license, core__media_entries.file_size AS core__media_entries_file_size, core__media_entries.location AS core__media_entries_location, core__media_entries.created AS core__media_entries_created, core__media_entries.updated AS core__media_entries_updated, core__media_entries.fail_error AS core__media_entries_fail_error, core__media_entries.fail_metadata AS core__media_entries_fail_metadata, core__media_entries.transcoding_progress AS core__media_entries_transcoding_progress, core__media_entries.queued_media_file AS core__media_entries_queued_media_file, core__media_entries.queued_task_id AS core__media_entries_queued_task_id, core__media_entries.media_metadata AS core__media_entries_media_metadata
FROM core__media_entries, core__media_tags
WHERE core__media_entries.state = 'processed' AND (core__media_entries.id = core__media_tags.media_entry AND core__media_tags.name ILIKE '%stallman%' OR core__media_entries.title ILIKE '%stallman%' OR core__media_entries.description ILIKE '%stallman%') ORDER BY core__media_entries.title) AS anon_1
2019-09-12 20:06:54 UTC LOG: duration: 61389.786 ms statement: SELECT count(*) AS count_1
FROM (SELECT core__media_entries.id AS core__media_entries_id, core__media_entries.public_id AS core__media_entries_public_id, core__media_entries.remote AS core__media_entries_remote, core__media_entries.actor AS core__media_entries_actor, core__media_entries.title AS core__media_entries_title, core__media_entries.slug AS core__media_entries_slug, core__media_entries.description AS core__media_entries_description, core__media_entries.media_type AS core__media_entries_media_type, core__media_entries.state AS core__media_entries_state, core__media_entries.license AS core__media_entries_license, core__media_entries.file_size AS core__media_entries_file_size, core__media_entries.location AS core__media_entries_location, core__media_entries.created AS core__media_entries_created, core__media_entries.updated AS core__media_entries_updated, core__media_entries.fail_error AS core__media_entries_fail_error, core__media_entries.fail_metadata AS core__media_entries_fail_metadata, core__media_entries.transcoding_progress AS core__media_entries_transcoding_progress, core__media_entries.queued_media_file AS core__media_entries_queued_media_file, core__media_entries.queued_task_id AS core__media_entries_queued_task_id, core__media_entries.media_metadata AS core__media_entries_media_metadata
FROM core__media_entries, core__media_tags
WHERE core__media_entries.state = 'processed' AND (core__media_entries.id = core__media_tags.media_entry AND core__media_tags.name ILIKE '%stallman%' OR core__media_entries.title ILIKE '%stallman%' OR core__media_entries.description ILIKE '%stallman%') ORDER BY core__media_entries.title
LIMIT 30) AS anon_1
2019-09-12 20:07:51 UTC LOG: duration: 57949.570 ms statement: SELECT core__media_entries.id AS core__media_entries_id, core__media_entries.public_id AS core__media_entries_public_id, core__media_entries.remote AS core__media_entries_remote, core__media_entries.actor AS core__media_entries_actor, core__media_entries.title AS core__media_entries_title, core__media_entries.slug AS core__media_entries_slug, core__media_entries.description AS core__media_entries_description, core__media_entries.media_type AS core__media_entries_media_type, core__media_entries.state AS core__media_entries_state, core__media_entries.license AS core__media_entries_license, core__media_entries.file_size AS core__media_entries_file_size, core__media_entries.location AS core__media_entries_location, core__media_entries.created AS core__media_entries_created, core__media_entries.updated AS core__media_entries_updated, core__media_entries.fail_error AS core__media_entries_fail_error, core__media_entries.fail_metadata AS core__media_entries_fail_metadata, core__media_entries.transcoding_progress AS core__media_entries_transcoding_progress, core__media_entries.queued_media_file AS core__media_entries_queued_media_file, core__media_entries.queued_task_id AS core__media_entries_queued_task_id, core__media_entries.media_metadata AS core__media_entries_media_metadata, core__locations_1.id AS core__locations_1_id, core__locations_1.name AS core__locations_1_name, core__locations_1.position AS core__locations_1_position, core__locations_1.address AS core__locations_1_address
FROM core__media_tags, core__media_entries LEFT OUTER JOIN core__locations AS core__locations_1 ON core__locations_1.id = core__media_entries.location
WHERE core__media_entries.state = 'processed' AND (core__media_entries.id = core__media_tags.media_entry AND core__media_tags.name ILIKE '%stallman%' OR core__media_entries.title ILIKE '%stallman%' OR core__media_entries.description ILIKE '%stallman%') ORDER BY core__media_entries.title
LIMIT 30
I don't know how to optimize things, but our database is not that big so this shouldn't happen.