@Gargron Since it is PostgreSQL 10 or later, you can improve the capacity and search speed by changing index_statuses_on_uri to hash. I don't know what the DB size of mastodon.social is, but I think it is very effective.
Note: For PostgreSQL 9.x, hash type indexes are not recommended.
The attached image is an example at fedibird.com.